summaryrefslogtreecommitdiffstats
path: root/tox.ini
diff options
context:
space:
mode:
Diffstat (limited to 'tox.ini')
-rw-r--r--tox.ini67
1 files changed, 67 insertions, 0 deletions
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..0c0bec0
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,67 @@
+[tox]
+minversion = 3.16.1
+envlist =
+ linters
+ docs
+ packaging
+ py{36,37,38,39,310}
+isolated_build = true
+requires =
+ setuptools >= 41.4.0
+ pip >= 19.3.0
+skip_missing_interpreters = False
+
+[testenv]
+description = Unittest using {basepython}
+commands =
+ /bin/bash -c 'pytest _test/test_*.py'
+deps =
+ pytest
+allowlist_externals =
+ make
+ sh
+
+[testenv:docs]
+description = Build docs
+basepython = python3.8
+deps =
+ --editable .[docs]
+commands =
+ make singlehtml
+changedir = {toxinidir}/_doc
+
+[testenv:linters]
+description = Linting
+basepython = python3.8
+deps =
+ pre-commit>=2.8.2
+ flake8
+ flake8-bugbear
+commands =
+ pre-commit run -a
+
+[testenv:packaging]
+description =
+ Do packaging/distribution
+# `usedevelop = true` overrides `skip_install` instruction, it's unwanted
+usedevelop = false
+# don't install package itself in this env
+skip_install = true
+deps =
+ build >= 0.7.0
+ twine >= 3.7.0
+setenv =
+commands =
+ # build wheel and sdist using PEP-517
+ {envpython} -c 'import os.path, shutil, sys; \
+ dist_dir = os.path.join("{toxinidir}", "dist"); \
+ os.path.isdir(dist_dir) or sys.exit(0); \
+ print("Removing \{!s\} contents...".format(dist_dir), file=sys.stderr); \
+ shutil.rmtree(dist_dir)'
+ {envpython} -m build \
+ --outdir {toxinidir}/dist/ \
+ {toxinidir}
+ # Validate metadata using twine
+ twine check --strict {toxinidir}/dist/*
+ # Install the wheel
+ sh -c "python3 -m pip install --force-reinstall {toxinidir}/dist/*.whl"