diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2021-12-23 11:33:55 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2021-12-23 11:33:55 -0500 |
commit | 5aa85727feea77536ea8a85a55dea26f2c5e899e (patch) | |
tree | f8586e13a7771db698606fecfb990f15795976cd /setuptools/_distutils/command | |
parent | 52c990172fec37766b3566679724aa8bf70ae06d (diff) | |
parent | 9867e2e42ad5468793b2e7c3bf69d99d95bcc5e1 (diff) | |
download | python-setuptools-git-5aa85727feea77536ea8a85a55dea26f2c5e899e.tar.gz |
Merge https://github.com/pypa/distutils into bugfix/distutils88
Diffstat (limited to 'setuptools/_distutils/command')
-rw-r--r-- | setuptools/_distutils/command/install.py | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/setuptools/_distutils/command/install.py b/setuptools/_distutils/command/install.py index 4f944725..65844927 100644 --- a/setuptools/_distutils/command/install.py +++ b/setuptools/_distutils/command/install.py @@ -81,11 +81,6 @@ 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. @@ -124,7 +119,8 @@ def _get_implementation(): def _select_scheme(ob, name): - vars(ob).update(_remove_set(ob, _scheme_attrs(_resolve_scheme(name)))) + scheme = _inject_headers(name, _load_scheme(_resolve_scheme(name))) + vars(ob).update(_remove_set(ob, _scheme_attrs(scheme))) def _remove_set(ob, attrs): @@ -147,9 +143,26 @@ def _resolve_scheme(name): return resolved -def _scheme_attrs(name): +def _load_scheme(name): + return _load_schemes()[name] + + +def _inject_headers(name, scheme): + """ + Given a scheme name and the resolved scheme, + if the scheme does not include headers, resolve + the fallback scheme for the name and use headers + from it. pypa/distutils#88 + """ + # Bypass the preferred scheme, which may not + # have defined headers. + fallback = _load_scheme(_pypy_hack(name)) + scheme.setdefault('headers', fallback['headers']) + return scheme + + +def _scheme_attrs(scheme): """Resolve install directories by applying the install schemes.""" - scheme = _load_schemes()[name] return { f'install_{key}': scheme[key] for key in SCHEME_KEYS @@ -395,7 +408,8 @@ class install(Command): 'platlibdir': getattr(sys, 'platlibdir', 'lib'), 'implementation_lower': _get_implementation().lower(), 'implementation': _get_implementation(), - 'platsubdir': sysconfig.get_config_var('platsubdir'), + # all values must be str; see #86 + 'platsubdir': str(sysconfig.get_config_var('platsubdir')), } if HAS_USER_SITE: |