MCPcopy Index your code
hub / github.com/python/cpython / get_pip_layout

Function get_pip_layout

PC/layout/support/pip.py:28–41  ·  view source on GitHub ↗
(ns)

Source from the content-addressed store, hash-verified

26
27
28def get_pip_layout(ns):
29 pip_dir = get_pip_dir(ns)
30 if not pip_dir.is_dir():
31 log_warning("Failed to find {} - pip will not be included", pip_dir)
32 else:
33 pkg_root = "packages/{}" if ns.zip_lib else "Lib/site-packages/{}"
34 for dest, src in rglob(pip_dir, "**/*"):
35 yield pkg_root.format(dest), src
36 if ns.include_pip_user:
37 content = "\n".join(
38 "[{}]\nuser=yes".format(n)
39 for n in ["install", "uninstall", "freeze", "list"]
40 )
41 yield "pip.ini", ("pip.ini", content.encode())
42
43
44def extract_pip_files(ns):

Callers 1

get_layoutFunction · 0.85

Calls 7

get_pip_dirFunction · 0.85
log_warningFunction · 0.85
rglobFunction · 0.85
is_dirMethod · 0.45
formatMethod · 0.45
joinMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…