'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.
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):
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
'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: