[Python-checkins] cpython (3.4): Closes #24267 - Does not check version on ensurepip uninstall

donald.stufft python-checkins at python.org
Tue Jun 2 16:37:16 CEST 2015


https://hg.python.org/cpython/rev/aaa015dde686
changeset:   96475:aaa015dde686
branch:      3.4
parent:      96466:dbf3aa36bea7
user:        Donald Stufft <donald at stufft.io>
date:        Tue Jun 02 10:37:08 2015 -0400
summary:
  Closes #24267 - Does not check version on ensurepip uninstall

Ensure that the uninstall helper for Windows passes the proper
flags to pip to prevent it from checking PyPI if the pip that
we're currently attempting to uninstall is the latest verison.

files:
  Lib/ensurepip/__init__.py  |   2 +-
  Lib/test/test_ensurepip.py |  25 ++++++++++++++++++++-----
  2 files changed, 21 insertions(+), 6 deletions(-)


diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py
--- a/Lib/ensurepip/__init__.py
+++ b/Lib/ensurepip/__init__.py
@@ -137,7 +137,7 @@
     _disable_pip_configuration_settings()
 
     # Construct the arguments to be passed to the pip command
-    args = ["uninstall", "-y"]
+    args = ["uninstall", "-y", "--disable-pip-version-check"]
     if verbosity:
         args += ["-" + "v" * verbosity]
 
diff --git a/Lib/test/test_ensurepip.py b/Lib/test/test_ensurepip.py
--- a/Lib/test/test_ensurepip.py
+++ b/Lib/test/test_ensurepip.py
@@ -211,7 +211,10 @@
             ensurepip._uninstall_helper()
 
         self.run_pip.assert_called_once_with(
-            ["uninstall", "-y", "pip", "setuptools"]
+            [
+                "uninstall", "-y", "--disable-pip-version-check", "pip",
+                "setuptools",
+            ]
         )
 
     @requires_usable_pip
@@ -220,7 +223,10 @@
             ensurepip._uninstall_helper(verbosity=1)
 
         self.run_pip.assert_called_once_with(
-            ["uninstall", "-y", "-v", "pip", "setuptools"]
+            [
+                "uninstall", "-y", "--disable-pip-version-check", "-v", "pip",
+                "setuptools",
+            ]
         )
 
     @requires_usable_pip
@@ -229,7 +235,10 @@
             ensurepip._uninstall_helper(verbosity=2)
 
         self.run_pip.assert_called_once_with(
-            ["uninstall", "-y", "-vv", "pip", "setuptools"]
+            [
+                "uninstall", "-y", "--disable-pip-version-check", "-vv", "pip",
+                "setuptools",
+            ]
         )
 
     @requires_usable_pip
@@ -238,7 +247,10 @@
             ensurepip._uninstall_helper(verbosity=3)
 
         self.run_pip.assert_called_once_with(
-            ["uninstall", "-y", "-vvv", "pip", "setuptools"]
+            [
+                "uninstall", "-y", "--disable-pip-version-check", "-vvv",
+                "pip", "setuptools",
+            ]
         )
 
     @requires_usable_pip
@@ -336,7 +348,10 @@
             ensurepip._uninstall._main([])
 
         self.run_pip.assert_called_once_with(
-            ["uninstall", "-y", "pip", "setuptools"]
+            [
+                "uninstall", "-y", "--disable-pip-version-check", "pip",
+                "setuptools",
+            ]
         )
 
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list