Skip to content

Commit 436cd2c

Browse files
bpo-38114: Do not include pip.ini in Nuget package (GH-15964)
(cherry picked from commit 19f6940) Co-authored-by: Steve Dower <steve.dower@python.org>
1 parent 43ee0e2 commit 436cd2c

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The ``pip.ini`` is no longer included in the Nuget package.

PC/layout/support/options.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def public(f):
1717
OPTIONS = {
1818
"stable": {"help": "stable ABI stub"},
1919
"pip": {"help": "pip"},
20+
"pip-user": {"help": "pip.ini file for default --user"},
2021
"distutils": {"help": "distutils"},
2122
"tcltk": {"help": "Tcl, Tk and tkinter"},
2223
"idle": {"help": "Idle"},
@@ -42,6 +43,7 @@ def public(f):
4243
"options": [
4344
"stable",
4445
"pip",
46+
"pip-user",
4547
"distutils",
4648
"tcltk",
4749
"idle",

PC/layout/support/pip.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ def get_pip_layout(ns):
3333
pkg_root = "packages/{}" if ns.zip_lib else "Lib/site-packages/{}"
3434
for dest, src in rglob(pip_dir, "**/*"):
3535
yield pkg_root.format(dest), src
36-
content = "\n".join(
37-
"[{}]\nuser=yes".format(n)
38-
for n in ["install", "uninstall", "freeze", "list"]
39-
)
40-
yield "pip.ini", ("pip.ini", content.encode())
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())
4142

4243

4344
def extract_pip_files(ns):

0 commit comments

Comments
 (0)