Let us walk on the 3-isogeny graph
|
Namespaces | |
namespace | _distutils |
namespace | _sysconfig |
namespace | base |
Functions | |
bool | _should_use_sysconfig () |
bool | _looks_like_bpo_44860 () |
bool | _looks_like_red_hat_patched_platlib_purelib (Dict[str, str] scheme) |
bool | _looks_like_red_hat_lib () |
bool | _looks_like_debian_scheme () |
bool | _looks_like_red_hat_scheme () |
bool | _looks_like_slackware_scheme () |
bool | _looks_like_msys2_mingw_scheme () |
Generator[str, None, None] | _fix_abiflags (Tuple[str] parts) |
None | _warn_mismatched (pathlib.Path old, pathlib.Path new, *str key) |
bool | _warn_if_mismatch (pathlib.Path old, pathlib.Path new, *str key) |
None | _log_context (*bool user=False, Optional[str] home=None, Optional[str] root=None, Optional[str] prefix=None) |
Scheme | get_scheme (str dist_name, bool user=False, Optional[str] home=None, Optional[str] root=None, bool isolated=False, Optional[str] prefix=None) |
str | get_bin_prefix () |
str | get_bin_user () |
bool | _looks_like_deb_system_dist_packages (str value) |
str | get_purelib () |
str | get_platlib () |
Variables | |
logger = logging.getLogger(__name__) | |
str | _PLATLIBDIR = getattr(sys, "platlibdir", "lib") |
tuple | _USE_SYSCONFIG_DEFAULT = (3, 10) |
bool | _USE_SYSCONFIG = _should_use_sysconfig() |
_MISMATCH_LEVEL = logging.WARNING | |
Definition at line 177 of file __init__.py.
References i.
Referenced by pip._internal.locations.get_scheme().
|
protected |
Definition at line 212 of file __init__.py.
References i.
Referenced by pip._internal.locations.get_bin_prefix(), pip._internal.locations.get_platlib(), pip._internal.locations.get_purelib(), and pip._internal.locations.get_scheme().
|
protected |
The resolution to bpo-44860 will change this incorrect platlib. See <https://bugs.python.org/issue44860>.
Definition at line 76 of file __init__.py.
References i.
Referenced by pip._internal.locations.get_scheme().
|
protected |
Check if the value is Debian's APT-controlled dist-packages. Debian's ``distutils.sysconfig.get_python_lib()`` implementation returns the default package path controlled by APT, but does not patch ``sysconfig`` to do the same. This is similar to the bug worked around in ``get_scheme()``, but here the default is ``deb_system`` instead of ``unix_local``. Ultimately we can't do anything about this Debian bug, and this detection allows us to skip the warning when needed.
Definition at line 423 of file __init__.py.
References pip._internal.locations._looks_like_debian_scheme().
Referenced by pip._internal.locations.get_platlib(), and pip._internal.locations.get_purelib().
|
protected |
Debian adds two additional schemes.
Definition at line 116 of file __init__.py.
References i.
Referenced by pip._internal.locations._looks_like_deb_system_dist_packages(), and pip._internal.locations.get_scheme().
|
protected |
MSYS2 patches distutils and sysconfig to use a UNIX-like scheme. However, MSYS2 incorrectly patches sysconfig ``nt`` scheme. The fix is likely going to be included in their 3.10 release, so we ignore the warning. See msys2/MINGW-packages#9319. MSYS2 MINGW's patch uses lowercase ``"lib"`` instead of the usual uppercase, and is missing the final ``"site-packages"``.
Definition at line 160 of file __init__.py.
References i.
Referenced by pip._internal.locations.get_scheme().
|
protected |
Red Hat patches platlib in unix_prefix and unix_home, but not purelib. This is the only way I can see to tell a Red Hat-patched Python.
Definition at line 101 of file __init__.py.
References pip._internal.locations._looks_like_red_hat_patched_platlib_purelib(), and i.
Referenced by pip._internal.locations.get_scheme().
|
protected |
Definition at line 90 of file __init__.py.
References i.
Referenced by pip._internal.locations._looks_like_red_hat_lib().
|
protected |
Red Hat patches ``sys.prefix`` and ``sys.exec_prefix``. Red Hat's ``00251-change-user-install-location.patch`` changes the install command's ``prefix`` and ``exec_prefix`` to append ``"/local"``. This is (fortunately?) done quite unconditionally, so we create a default command object without any configuration to detect this.
Definition at line 124 of file __init__.py.
References i.
Referenced by pip._internal.locations.get_scheme().
|
protected |
Slackware patches sysconfig but fails to patch distutils and site. Slackware changes sysconfig's user scheme to use ``"lib64"`` for the lib path, but does not do the same to the site module.
Definition at line 144 of file __init__.py.
References i.
Referenced by pip._internal.locations.get_scheme().
|
protected |
This function determines the value of _USE_SYSCONFIG. By default, pip uses sysconfig on Python 3.10+. But Python distributors can override this decision by setting: sysconfig._PIP_USE_SYSCONFIG = True / False Rationale in https://github.com/pypa/pip/issues/10647 This is a function for testability, but should be constant during any one run.
Definition at line 46 of file __init__.py.
References i.
|
protected |
Definition at line 204 of file __init__.py.
References pip._internal.locations._warn_mismatched(), and i.
Referenced by pip._internal.locations.get_bin_prefix(), pip._internal.locations.get_platlib(), and pip._internal.locations.get_purelib().
|
protected |
Definition at line 194 of file __init__.py.
References i.
Referenced by pip._internal.locations._warn_if_mismatch(), and pip._internal.locations.get_scheme().
str get_bin_prefix | ( | ) |
Definition at line 408 of file __init__.py.
References pip._internal.locations._log_context(), pip._internal.locations._warn_if_mismatch(), and i.
str get_bin_user | ( | ) |
Definition at line 419 of file __init__.py.
References i.
str get_platlib | ( | ) |
Return the default platform-shared lib location.
Definition at line 454 of file __init__.py.
References pip._internal.locations._log_context(), pip._internal.locations._looks_like_deb_system_dist_packages(), pip._internal.locations._warn_if_mismatch(), and i.
str get_purelib | ( | ) |
Return the default pure-Python lib location.
Definition at line 440 of file __init__.py.
References pip._internal.locations._log_context(), pip._internal.locations._looks_like_deb_system_dist_packages(), pip._internal.locations._warn_if_mismatch(), and i.
Scheme get_scheme | ( | str | dist_name, |
bool | user = False , |
||
Optional[str] | home = None , |
||
Optional[str] | root = None , |
||
bool | isolated = False , |
||
Optional[str] | prefix = None |
||
) |
Definition at line 230 of file __init__.py.
References pip._internal.locations._fix_abiflags(), pip._internal.locations._log_context(), pip._internal.locations._looks_like_bpo_44860(), pip._internal.locations._looks_like_debian_scheme(), pip._internal.locations._looks_like_msys2_mingw_scheme(), pip._internal.locations._looks_like_red_hat_lib(), pip._internal.locations._looks_like_red_hat_scheme(), pip._internal.locations._looks_like_slackware_scheme(), pip._internal.locations._warn_mismatched(), and i.
|
protected |
Definition at line 71 of file __init__.py.
|
protected |
Definition at line 41 of file __init__.py.
|
protected |
Definition at line 60 of file __init__.py.
|
protected |
Definition at line 43 of file __init__.py.
logger = logging.getLogger(__name__) |
Definition at line 38 of file __init__.py.