summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-08-14 10:35:41 -0400
committerJason R. Coombs <jaraco@jaraco.com>2020-08-14 10:35:41 -0400
commit6e3aa8d19eab0e984b1d2a2494f468fcad6bd798 (patch)
tree90d2b4810d4f14374080a7eb92bb8defb873cb3b
parent4837f218ea05a304880f8448e27fe0affad3a1a5 (diff)
downloadpython-setuptools-git-bugfix/2232-just-break-pip-upgrade.tar.gz
Fix test failures by disabling eager supplying of distutils when upgrading setuptools through pip.bugfix/2232-just-break-pip-upgrade
-rw-r--r--changelog.d/2232.breaking.rst2
-rw-r--r--setuptools/tests/test_virtualenv.py3
2 files changed, 4 insertions, 1 deletions
diff --git a/changelog.d/2232.breaking.rst b/changelog.d/2232.breaking.rst
index b2fd926f..b5a3c7e8 100644
--- a/changelog.d/2232.breaking.rst
+++ b/changelog.d/2232.breaking.rst
@@ -1 +1 @@
-Once again, Setuptools overrides the stdlib distutils on import. For environments or invocations where this behavior is undesirable, users are provided with a temporary escape hatch. If the environment variable ``SETUPTOOLS_USE_DISTUTILS`` is set to ``stdlib``, Setuptools will fall back to the legacy behavior. Use of this escape hatch is discouraged, but it is provided to ease the transition while proper fixes for edge cases can be addressed.
+Once again, Setuptools overrides the stdlib distutils on import. For environments or invocations where this behavior is undesirable, users are provided with a temporary escape hatch. If the environment variable ``SETUPTOOLS_USE_DISTUTILS`` is set to ``stdlib``, Setuptools will fall back to the legacy behavior. Use of this escape hatch is discouraged, but it is provided to ease the transition while proper fixes for edge cases can be addressed. Due to pip #8761, it is currently necessary to invoke this escape hatch when upgrading setuptools.
diff --git a/setuptools/tests/test_virtualenv.py b/setuptools/tests/test_virtualenv.py
index 555273ae..8b7a8b4e 100644
--- a/setuptools/tests/test_virtualenv.py
+++ b/setuptools/tests/test_virtualenv.py
@@ -119,6 +119,9 @@ def test_pip_upgrade_from_source(pip_version, virtualenv):
wheel = glob.glob(os.path.join(dist_dir, '*.whl'))[0]
# Then update from wheel.
virtualenv.run('pip install ' + wheel)
+ # As reported in pypa/pip#8761, pip cannot handle an upgrade when
+ # setuptools supplies distutils.
+ virtualenv.env['SETUPTOOLS_USE_DISTUTILS'] = 'stdlib'
# And finally try to upgrade from source.
virtualenv.run('pip install --no-cache-dir --upgrade ' + sdist)