summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Stufft <donald@stufft.io>2015-06-02 14:37:08 (GMT)
committerDonald Stufft <donald@stufft.io>2015-06-02 14:37:08 (GMT)
commit71a8589ddc11842680826f94da43b2e13a1c7d89 (patch)
tree444ddc16f914eba43cc6cf7dea8d4ab4a8260d65
parent11cf4f64986e1d9842d4b131fd6c477f51e3b27b (diff)
downloadcpython-71a8589ddc11842680826f94da43b2e13a1c7d89.zip
cpython-71a8589ddc11842680826f94da43b2e13a1c7d89.tar.gz
cpython-71a8589ddc11842680826f94da43b2e13a1c7d89.tar.bz2
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.
-rw-r--r--Lib/ensurepip/__init__.py2
-rw-r--r--Lib/test/test_ensurepip.py25
2 files changed, 21 insertions, 6 deletions
diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py
index 592ffde..e5db9f9 100644
--- a/Lib/ensurepip/__init__.py
+++ b/Lib/ensurepip/__init__.py
@@ -137,7 +137,7 @@ def _uninstall_helper(*, verbosity=0):
_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
index 759168e..6dc764b 100644
--- a/Lib/test/test_ensurepip.py
+++ b/Lib/test/test_ensurepip.py
@@ -211,7 +211,10 @@ class TestUninstall(EnsurepipMixin, unittest.TestCase):
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 @@ class TestUninstall(EnsurepipMixin, unittest.TestCase):
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 @@ class TestUninstall(EnsurepipMixin, unittest.TestCase):
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 @@ class TestUninstall(EnsurepipMixin, unittest.TestCase):
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 @@ class TestUninstallationMainFunction(EnsurepipMixin, unittest.TestCase):
ensurepip._uninstall._main([])
self.run_pip.assert_called_once_with(
- ["uninstall", "-y", "pip", "setuptools"]
+ [
+ "uninstall", "-y", "--disable-pip-version-check", "pip",
+ "setuptools",
+ ]
)