-
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-Authored-By: Bo Anderson <[email protected]>
- Loading branch information
1 parent
0767042
commit 8b5bcbb
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py | ||
index 80aef34..4af9376 100644 | ||
--- a/Lib/sysconfig/__init__.py | ||
+++ b/Lib/sysconfig/__init__.py | ||
@@ -98,6 +98,16 @@ _INSTALL_SCHEMES = { | ||
'scripts': '{base}/Scripts', | ||
'data': '{base}', | ||
}, | ||
+ 'osx_framework_library': { | ||
+ 'stdlib': '{installed_base}/{platlibdir}/python{py_version_short}', | ||
+ 'platstdlib': '{platbase}/{platlibdir}/python{py_version_short}', | ||
+ 'purelib': '@@HOMEBREW_PREFIX@@/lib/python{py_version_short}/site-packages', | ||
+ 'platlib': '@@HOMEBREW_PREFIX@@/{platlibdir}/python{py_version_short}/site-packages', | ||
+ 'include': '{installed_base}/include/python{py_version_short}{abiflags}', | ||
+ 'platinclude': '{installed_platbase}/include/python{py_version_short}{abiflags}', | ||
+ 'scripts': '@@HOMEBREW_PREFIX@@/bin', | ||
+ 'data': '@@HOMEBREW_PREFIX@@', | ||
+ }, | ||
} | ||
|
||
# For the OS-native venv scheme, we essentially provide an alias: | ||
@@ -288,20 +298,20 @@ def _get_preferred_schemes(): | ||
} | ||
if sys.platform == 'darwin' and sys._framework: | ||
return { | ||
- 'prefix': 'posix_prefix', | ||
+ 'prefix': 'osx_framework_library', | ||
'home': 'posix_home', | ||
'user': 'osx_framework_user', | ||
} | ||
|
||
return { | ||
- 'prefix': 'posix_prefix', | ||
+ 'prefix': 'osx_framework_library', | ||
'home': 'posix_home', | ||
'user': 'posix_user', | ||
} | ||
|
||
|
||
def get_preferred_scheme(key): | ||
- if key == 'prefix' and sys.prefix != sys.base_prefix: | ||
+ if key == 'prefix' and (sys.prefix != sys.base_prefix or os.environ.get("ENSUREPIP_OPTIONS", None)): | ||
return 'venv' | ||
scheme = _get_preferred_schemes()[key] | ||
if scheme not in _INSTALL_SCHEMES: |