Skip to content

Commit 5abe87d

Browse files
author
Nicholas Car
authored
Merge pull request #1450 from aucampia/iwana-20211017T1353-update_tox
Updated tox config to run mypy in default environment
2 parents f43ad3f + 8f153f5 commit 5abe87d

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

docs/developers.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,30 @@ Check types with `mypy <http://mypy-lang.org/>`_:
6464
6565
python -m mypy --show-error-context --show-error-codes rdflib
6666
67+
Using tox
68+
---------------------
69+
70+
RDFLib has a `tox <https://tox.wiki/en/latest/index.html>`_ config file that
71+
makes it easier to run validation on all supported python versions.
72+
73+
.. code-block:: bash
74+
75+
# install tox
76+
pip install tox
77+
78+
# list tox environments that run by default
79+
tox -e
80+
81+
# list all tox environments
82+
tox -a
83+
84+
# run default environment for all python versions
85+
tox
86+
87+
# run a specific environment
88+
tox -e py37 # default environment with py37
89+
tox -e py39-mypy # mypy environment with py39
90+
6791
Writing documentation
6892
---------------------
6993

tox.ini

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
[tox]
22
envlist =
3-
py37,py38,py39
3+
py37,py38,py39,py310
44

55
[testenv]
66
setenv =
77
BERKELEYDB_DIR = /usr
88
commands =
9+
{envpython} -m mypy rdflib --show-error-context --show-error-codes
910
{envpython} setup.py clean --all
1011
{envpython} setup.py build
1112
{envpython} -m pytest
@@ -26,9 +27,7 @@ deps =
2627
-rrequirements.txt
2728
-rrequirements.dev.txt
2829

29-
[testenv:mypy]
30-
basepython =
31-
python3.7
30+
[testenv:py3{7,8,9,10}-mypy]
3231
commands =
3332
{envpython} -m mypy rdflib --show-error-context --show-error-codes
3433
deps =

0 commit comments

Comments
 (0)