Skip to content

Commit

Permalink
Honor sysconfig.get_preferred_schemes when selecting install schemes. F…
Browse files Browse the repository at this point in the history
…ixes #76.
  • Loading branch information
jaraco committed Dec 17, 2021
1 parent da15b6e commit 1f928a1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion distutils/command/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@
'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.
Expand Down Expand Up @@ -515,9 +520,17 @@ def finalize_other(self):
"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:
Expand Down

0 comments on commit 1f928a1

Please sign in to comment.