Skip to content

Commit d364d2b

Browse files
committed
pyproject: Add testing for different python versions with tox
This change is needed for testing difference with python versions used on different distributions. Catching problems for example with f-string format. Ref: https://peps.python.org/pep-0701/ Signed-off-by: Arisu Tachibana <arisu.tachibana@miraclelinux.com>
1 parent 36dfc3e commit d364d2b

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

.github/workflows/poetry.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
99
- uses: actions/checkout@v4
1010
- name: Install Python
1111
uses: actions/setup-python@v5
12+
with:
13+
python-version: '3.11'
1214
- name: Install poetry
1315
uses: abatilo/actions-poetry@v3
1416
- name: Install shellcheck
@@ -28,5 +30,5 @@ jobs:
2830
run: poetry run black --check --verbose .
2931
- name: Isort check
3032
run: poetry run isort . --profile black --check --diff
31-
- name: Pytest check
32-
run: poetry run pytest -rP
33+
- name: Tox check (pytest)
34+
run: poetry run tox

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ black = "^24.8.0"
4949
isort = "^5.13.2"
5050
pytest = "^8.3.3"
5151
poethepoet = "^0.29.0"
52+
tox = "^4.24.1"
5253

5354
[tool.poe.tasks]
5455
check = "./scripts/check.sh"

scripts/check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
poetry run black . --extend-exclude="kcidev-src"
44
poetry run isort . --extend-skip="kcidev-src"
5-
poetry run pytest -rP --ignore="kcidev-src"
5+
poetry run tox

tox.ini

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[tox]
2+
env_list = py311,py312
3+
4+
[testenv]
5+
allowlist_externals = poetry
6+
commands_pre =
7+
poetry install --no-root
8+
poetry sync
9+
commands =
10+
poetry run pytest tests/ --import-mode importlib
11+

0 commit comments

Comments
 (0)