Skip to content

Fix condition for triggering warning on macOS bogus sysconfig #11741

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions news/11741.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix condition for triggering warning on macOS bogus sysconfig.
5 changes: 3 additions & 2 deletions src/pip/_internal/locations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,9 @@ def _looks_like_apple_library(path: str) -> bool:
def get_isolated_environment_lib_paths(prefix: str) -> List[str]:
"""Return the lib locations under ``prefix``."""
new_pure, new_plat = _sysconfig.get_isolated_environment_lib_paths(prefix)
new_lib_paths = _deduplicated(new_pure, new_plat)
if _USE_SYSCONFIG:
return _deduplicated(new_pure, new_plat)
return new_lib_paths

old_pure, old_plat = _distutils.get_isolated_environment_lib_paths(prefix)
old_lib_paths = _deduplicated(old_pure, old_plat)
Expand All @@ -497,7 +498,7 @@ def get_isolated_environment_lib_paths(prefix: str) -> List[str]:
# cause serious build isolation bugs when Apple starts shipping 3.10 because
# pip will install build backends to the wrong location. This tells users
# who is at fault so Apple may notice it and fix the issue in time.
if all(_looks_like_apple_library(p) for p in old_lib_paths):
if all(_looks_like_apple_library(p) for p in new_lib_paths):
deprecated(
reason=(
"Python distributed by Apple's Command Line Tools incorrectly "
Expand Down