Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[email protected]: modify sysconfig #941

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions python/3.13-sysconfig.diff
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: