Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
pip._internal.build_env Namespace Reference

Data Structures

class  _Prefix
 
class  BuildEnvironment
 
class  NoOpBuildEnvironment
 

Functions

Union[Tuple[str], Tuple[str, str]] _dedup (str a, str b)
 
str get_runnable_pip ()
 
Set[str] _get_system_sitepackages ()
 

Variables

 logger = logging.getLogger(__name__)
 

Detailed Description

Build Environment used for isolation during sdist building

Function Documentation

◆ _dedup()

Union[Tuple[str], Tuple[str, str]] _dedup ( str  a,
str  b 
)
protected

Definition at line 31 of file build_env.py.

31def _dedup(a: str, b: str) -> Union[Tuple[str], Tuple[str, str]]:
32 return (a, b) if a != b else (a,)
33
34

◆ _get_system_sitepackages()

Set[str] _get_system_sitepackages ( )
protected
Get system site packages

Usually from site.getsitepackages,
but fallback on `get_purelib()/get_platlib()` if unavailable
(e.g. in a virtualenv created by virtualenv<20)

Returns normalized set of strings.

Definition at line 60 of file build_env.py.

60def _get_system_sitepackages() -> Set[str]:
61 """Get system site packages
62
63 Usually from site.getsitepackages,
64 but fallback on `get_purelib()/get_platlib()` if unavailable
65 (e.g. in a virtualenv created by virtualenv<20)
66
67 Returns normalized set of strings.
68 """
69 if hasattr(site, "getsitepackages"):
70 system_sites = site.getsitepackages()
71 else:
72 # virtualenv < 20 overwrites site.py without getsitepackages
73 # fallback on get_purelib/get_platlib.
74 # this is known to miss things, but shouldn't in the cases
75 # where getsitepackages() has been removed (inside a virtualenv)
76 system_sites = [get_purelib(), get_platlib()]
77 return {os.path.normcase(path) for path in system_sites}
78
79
for i

References i.

◆ get_runnable_pip()

str get_runnable_pip ( )
Get a file to pass to a Python executable, to run the currently-running pip.

This is used to run a pip subprocess, for installing requirements into the build
environment.

Definition at line 44 of file build_env.py.

44def get_runnable_pip() -> str:
45 """Get a file to pass to a Python executable, to run the currently-running pip.
46
47 This is used to run a pip subprocess, for installing requirements into the build
48 environment.
49 """
50 source = pathlib.Path(pip_location).resolve().parent
51
52 if not source.is_dir():
53 # This would happen if someone is using pip from inside a zip file. In that
54 # case, we can use that directly.
55 return str(source)
56
57 return os.fsdecode(source / "__pip-runner__.py")
58
59

References i.

Referenced by BuildEnvironment.install_requirements().

Here is the caller graph for this function:

Variable Documentation

◆ logger

logger = logging.getLogger(__name__)

Definition at line 28 of file build_env.py.