Skip to content

Commit

Permalink
Avoid upgrading setuptools when creating the venv for distutils_adopt…
Browse files Browse the repository at this point in the history
…ion tests. Works around issue with upgrading on PyPy.
  • Loading branch information
jaraco committed Nov 11, 2021
1 parent 39e3806 commit 3542082
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ testing =
wheel
paver
pip>=19.1 # For proper file:// URLs support.
jaraco.envs
jaraco.envs>=2.2
pytest-xdist
sphinx
jaraco.path>=3.2.0
Expand Down
9 changes: 5 additions & 4 deletions setuptools/tests/test_distutils_adoption.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
import path


IS_PYPY = '__pypy__' in sys.builtin_module_names


class VirtualEnv(jaraco.envs.VirtualEnv):
name = '.env'
# Some version of PyPy will import distutils on startup, implicitly
# importing setuptools, and thus leading to BackendInvalid errors
# when upgrading Setuptools. Bypass this behavior by avoiding the
# early availability and need to upgrade.
create_opts = ['--no-setuptools']

def run(self, cmd, *args, **kwargs):
cmd = [self.exe(cmd[0])] + cmd[1:]
Expand Down Expand Up @@ -61,7 +63,6 @@ def test_distutils_local_with_setuptools(venv):
assert venv.name in loc.split(os.sep)


@pytest.mark.xfail('IS_PYPY', reason='pypy imports distutils on startup')
def test_distutils_local(venv):
"""
Even without importing, the setuptools-local copy of distutils is
Expand Down

0 comments on commit 3542082

Please sign in to comment.