Skip to content

Commit a17b8d1

Browse files
add own ci job for legacy setuptools testing an skip it for normal tests
1 parent 86d11ca commit a17b8d1

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

.github/workflows/python-tests.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@ jobs:
4949
if: matrix.os == 'ubuntu-latest'
5050
- run: pytest
5151

52+
test_legacy_setuptools:
53+
runs-on: ubuntu-lates
54+
steps:
55+
- uses: actions/checkout@v1
56+
- name: Setup python
57+
uses: actions/setup-python@v2
58+
with:
59+
python-version: "3.6"
60+
architecture: x64
61+
- run: pip install -e .[toml] pytest virtualenv
62+
- run: pytest --test-legacy testing/test_setuptools_support.py
5263
check_selfinstall:
5364
runs-on: ubuntu-latest
5465
strategy:

testing/conftest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ def pytest_report_header():
2020
return res
2121

2222

23+
def pytest_addoption(parser):
24+
group = parser.getgroup("setuptools_scm")
25+
group.addoption(
26+
"--test-legacy", dest="scm_test_virtualenv", default=False, action="store_true"
27+
)
28+
29+
2330
class Wd:
2431
commit_command = None
2532
add_command = None

testing/test_setuptools_support.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ def get_venv(self, python, pip, setuptools, prefix="scm"):
5959

6060
@pytest.fixture
6161
def venv_maker(pytestconfig):
62+
if not pytestconfig.getoption("--test-legacy"):
63+
pytest.skip(
64+
"testing on legacy setuptools disabled, pass --test-legacy to run them"
65+
)
6266
dir = pytestconfig.cache.makedir("setuptools_scm_venvs")
6367
path = pathlib.Path(str(dir))
6468
return VenvMaker(path)

0 commit comments

Comments
 (0)