Skip to content

Commit

Permalink
Merge pull request #2865 from mkoeppe/github_workflows_SETUPTOOLS_USE…
Browse files Browse the repository at this point in the history
…_DISTUTILS

Test SETUPTOOLS_USE_DISTUTILS = stdlib, local on GH Actions
  • Loading branch information
jaraco authored Nov 12, 2021
2 parents 0765143 + ba6aa7c commit 8ab7799
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ jobs:
test:
strategy:
matrix:
distutils:
- stdlib
- local
python:
- pypy3
- 3.6
Expand All @@ -16,6 +19,8 @@ jobs:
- macos-latest
- windows-latest
runs-on: ${{ matrix.platform }}
env:
SETUPTOOLS_USE_DISTUTILS: ${{ matrix.distutils }}
steps:
- uses: actions/checkout@v2
- name: Setup Python
Expand Down
12 changes: 12 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,15 @@ filterwarnings=

# https://github.com/pypa/setuptools/issues/2497
ignore:.* is an invalid version and will not be supported::pkg_resources

# https://github.com/pypa/setuptools/pull/2865#issuecomment-965700112
# ideally would apply to Python 3.10+ when
# SETUPTOOLS_USE_DISTUTILS=stdlib but for
# https://github.com/pytest-dev/pytest/discussions/9296
ignore:The distutils.sysconfig module is deprecated, use sysconfig instead

# Workaround for pypa/setuptools#2868
# ideally would apply to PyPy only but for
# https://github.com/pytest-dev/pytest/discussions/9296
ignore:Distutils was imported before setuptools
ignore:Setuptools is replacing distutils
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ testing =
mock
flake8-2020
virtualenv>=13.0.0
pytest-virtualenv>=1.2.7
pytest-virtualenv @ git+https://github.com/jaraco/pytest-plugins@distutils-deprecated#subdirectory=pytest-virtualenv
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
5 changes: 5 additions & 0 deletions setuptools/tests/test_distutils_adoption.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

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
4 changes: 4 additions & 0 deletions setuptools/tests/test_virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ def skip_network(param):
return list(versions)


@pytest.mark.skipif(
'platform.python_implementation() == "PyPy"',
reason="https://github.com/pypa/setuptools/pull/2865#issuecomment-965834995",
)
@pytest.mark.parametrize('pip_version', _get_pip_versions())
def test_pip_upgrade_from_source(pip_version, tmp_src, virtualenv):
"""
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ commands =
usedevelop = True
extras = testing
passenv =
SETUPTOOLS_USE_DISTUTILS
windir # required for test_pkg_resources

[testenv:docs]
Expand Down

0 comments on commit 8ab7799

Please sign in to comment.