diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2021-12-17 10:13:33 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2021-12-17 10:19:12 -0500 |
| commit | f32af4e73a3f994f3a76898bb404919c5722508d (patch) | |
| tree | 236e9ac8e7391c852b767bf433e2613d5772b4fe /distutils/command | |
| parent | da15b6e30ec48a3472b518b63c63ce6363b4e1cd (diff) | |
| download | python-setuptools-git-f32af4e73a3f994f3a76898bb404919c5722508d.tar.gz | |
Honor sysconfig.get_preferred_scheme when selecting install schemes. Fixes #76.
Diffstat (limited to 'distutils/command')
| -rw-r--r-- | distutils/command/install.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/distutils/command/install.py b/distutils/command/install.py index 407b96d6..80f5f8c7 100644 --- a/distutils/command/install.py +++ b/distutils/command/install.py @@ -81,6 +81,11 @@ if HAS_USER_SITE: 'data' : '{userbase}', } + INSTALL_SCHEMES['osx_framework_user'] = { + 'headers': + '{userbase}/include/{implementation_lower}{py_version_short}{abiflags}/{dist_name}', + } + # The keys to an installation scheme; if any new types of files are to be # installed, be sure to add an entry to every installation scheme above, # and to SCHEME_KEYS here. @@ -515,9 +520,17 @@ class install(Command): "I don't know how to install stuff on '%s'" % os.name) def select_scheme(self, name): + os_name, sep, key = name.partition('_') + try: + resolved = sysconfig.get_preferred_scheme(key) + except Exception: + resolved = self._pypy_hack(name) + return self._select_scheme(resolved) + + def _select_scheme(self, name): """Sets the install directories by applying the install schemes.""" # it's the caller's problem if they supply a bad name! - scheme = _load_schemes()[self._pypy_hack(name)] + scheme = _load_schemes()[name] for key in SCHEME_KEYS: attrname = 'install_' + key if getattr(self, attrname) is None: |
