Skip to content

Commit 7956523

Browse files
committed
chore: added a tox.ini file for easier local testing against all Python versions
1 parent 3c0ca06 commit 7956523

File tree

5 files changed

+34
-0
lines changed

5 files changed

+34
-0
lines changed

CONTRIBUTING.md

+14
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,20 @@ pdm run test
7575

7676
The test suite is still simple and needs expansion! Please help write more test cases.
7777

78+
!!! note
79+
You can also run your test suite against all supported Python version using `tox` with the `tox-pdm` plugin.
80+
You can either run it by yourself with:
81+
82+
```shell
83+
tox
84+
```
85+
86+
or from `pdm` with:
87+
88+
```shell
89+
pdm run tox
90+
```
91+
7892
### Code style
7993

8094
PDM uses `pre-commit` for linting. Install `pre-commit` first, then:

docs/mkdocs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ nav:
5858
- dev/benchmark.md
5959

6060
markdown_extensions:
61+
- admonition
6162
- pymdownx.highlight:
6263
linenums: true
6364
- pymdownx.superfences

news/1160.misc.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Provides a `tox.ini` file for easier local testing against all Python versions.

pyproject.toml

+5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ version = {use_scm = true}
6464
pre_release = "python tasks/max_versions.py"
6565
release = "python tasks/release.py"
6666
test = "pytest"
67+
tox = "tox"
6768
doc = {shell = "cd docs && mkdocs serve", help = "Start the dev server for doc preview"}
6869
lint = "pre-commit run --all-files"
6970
complete = {call = "tasks.complete:main", help = "Create autocomplete files for bash and fish"}
@@ -77,6 +78,10 @@ test = [
7778
"pytest-mock",
7879
"pytest-xdist>=1.31.0",
7980
]
81+
tox = [
82+
"tox",
83+
"tox-pdm",
84+
]
8085
doc = [
8186
"mkdocs>=1.1",
8287
"mkdocs-material>=7.3",

tox.ini

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[tox]
2+
envlist = py3{7,8,9,10,11}, lint
3+
passenv = LD_PRELOAD
4+
isolated_build = True
5+
6+
[testenv]
7+
groups = test
8+
commands = test {posargs}
9+
10+
[testenv:lint]
11+
groups = lint
12+
skip_install = true
13+
commands = lint

0 commit comments

Comments
 (0)