]> granicus.if.org Git - python/commitdiff
bpo-38114: Do not include pip.ini in Nuget package (GH-15964)
authorSteve Dower <steve.dower@python.org>
Wed, 11 Sep 2019 15:16:27 +0000 (16:16 +0100)
committerZachary Ware <zachary.ware@gmail.com>
Wed, 11 Sep 2019 15:16:27 +0000 (16:16 +0100)
Misc/NEWS.d/next/Windows/2019-09-11-15-24-04.bpo-38114.cc0E5E.rst [new file with mode: 0644]
PC/layout/support/options.py
PC/layout/support/pip.py

diff --git a/Misc/NEWS.d/next/Windows/2019-09-11-15-24-04.bpo-38114.cc0E5E.rst b/Misc/NEWS.d/next/Windows/2019-09-11-15-24-04.bpo-38114.cc0E5E.rst
new file mode 100644 (file)
index 0000000..5dab8d7
--- /dev/null
@@ -0,0 +1 @@
+The ``pip.ini`` is no longer included in the Nuget package.
index c8ae4e30a8c4a6bf00474d8c83e06a101b6b9a18..5e1543b59ccd59426f68cdf2fd2a7f80a5b396dd 100644 (file)
@@ -17,6 +17,7 @@ def public(f):
 OPTIONS = {
     "stable": {"help": "stable ABI stub"},
     "pip": {"help": "pip"},
+    "pip-user": {"help": "pip.ini file for default --user"},
     "distutils": {"help": "distutils"},
     "tcltk": {"help": "Tcl, Tk and tkinter"},
     "idle": {"help": "Idle"},
@@ -42,6 +43,7 @@ PRESETS = {
         "options": [
             "stable",
             "pip",
+            "pip-user",
             "distutils",
             "tcltk",
             "idle",
index 4ad3b1dd5bc0fa205929c4ea9cc239929c73c94b..c54acb250a252ed53965001104a7519875a79651 100644 (file)
@@ -33,11 +33,12 @@ def get_pip_layout(ns):
         pkg_root = "packages/{}" if ns.zip_lib else "Lib/site-packages/{}"
         for dest, src in rglob(pip_dir, "**/*"):
             yield pkg_root.format(dest), src
-        content = "\n".join(
-            "[{}]\nuser=yes".format(n)
-            for n in ["install", "uninstall", "freeze", "list"]
-        )
-        yield "pip.ini", ("pip.ini", content.encode())
+        if ns.include_pip_user:
+            content = "\n".join(
+                "[{}]\nuser=yes".format(n)
+                for n in ["install", "uninstall", "freeze", "list"]
+            )
+            yield "pip.ini", ("pip.ini", content.encode())
 
 
 def extract_pip_files(ns):