Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/developers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,30 @@ Check types with `mypy <http://mypy-lang.org/>`_:

python -m mypy --show-error-context --show-error-codes rdflib

Using tox
---------------------

RDFLib has a `tox <https://tox.wiki/en/latest/index.html>`_ config file that
makes it easier to run validation on all supported python versions.

.. code-block:: bash

# install tox
pip install tox

# list tox environments that run by default
tox -e

# list all tox environments
tox -a

# run default environment for all python versions
tox

# run a specific environment
tox -e py37 # default environment with py37
tox -e py39-mypy # mypy environment with py39

Writing documentation
---------------------

Expand Down
7 changes: 3 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[tox]
envlist =
py37,py38,py39
py37,py38,py39,py310

[testenv]
setenv =
BERKELEYDB_DIR = /usr
commands =
{envpython} -m mypy rdflib --show-error-context --show-error-codes
{envpython} setup.py clean --all
{envpython} setup.py build
{envpython} -m pytest
Expand All @@ -26,9 +27,7 @@ deps =
-rrequirements.txt
-rrequirements.dev.txt

[testenv:mypy]
basepython =
python3.7
[testenv:py3{7,8,9,10}-mypy]
commands =
{envpython} -m mypy rdflib --show-error-context --show-error-codes
deps =
Expand Down