Skip to content

Commit 87bfb92

Browse files
committed
test: use py3{py-minor-version} format rather than py3.{py-minor-version} for testenv name
This convention is more "tox-friendly", since an environment with 'py$MAJOR$MINOR' in its name will use the Python interpreter at version $MAJOR.MINOR as base python. In particular, in this way, we could avoid the repetition of different testenv configurations which only differ by the basepython variable. This change required a workaround in the GitHub Actions workflow configuration, since the Python version there has a dot that separates major and minor versions.
1 parent 3d19164 commit 87bfb92

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
run: pip install tox
2727
- name: Unit tests and coverage
2828
run: |
29+
pyver=`echo ${{ matrix.python-version }} | tr -d "."`
2930
tox -e py${{ matrix.python-version }}
3031
- name: Upload coverage to Codecov
3132
uses: codecov/codecov-action@v1

tox.ini

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = check-copyright, black-check, isort-check, docs, flake8, mypy, py3.8, py3.7
2+
envlist = check-copyright, black-check, isort-check, docs, flake8, mypy, py3{7,8,9,10}
33

44
[testenv]
55
setenv =
@@ -19,11 +19,9 @@ commands =
1919
--cov-report=html \
2020
--cov-report=term
2121

22-
[testenv:py3.7]
23-
basepython = python3.7
24-
25-
[testenv:py3.8]
26-
basepython = python3.8
22+
[testenv:py{37,38,39,310}]
23+
commands =
24+
{[testenv]commands}
2725

2826
[testenv:flake8]
2927
skip_install = True

0 commit comments

Comments
 (0)