diff --git a/pyproject.toml b/pyproject.toml index e9a99757..102683e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,4 +11,28 @@ addopts = """ --cov=nexgen --cov-report=xml --cov-branch """ junit_family = "xunit2" -testpaths = "src tests" \ No newline at end of file +testpaths = "src tests" + +# tox must currently be configured via an embedded ini string +# See: https://github.com/tox-dev/tox/issues/999 +[tool.tox] +legacy_tox_ini = """ +[tox] +skipsdist=True + +[testenv:{pre-commit,mypy,pytest,docs}] +# Don't create a virtualenv for the command, requires tox-direct plugin +direct = True +passenv = * +allowlist_externals = + pytest + pre-commit + mypy + sphinx-build + sphinx-autobuild +commands = + pytest: pytest {posargs} + mypy: mypy src tests --ignore-missing-imports --no-strict-optional {posargs} + pre-commit: pre-commit run --all-files {posargs} + docs: sphinx-{posargs:build -EW --keep-going} -T docs build/html +""" \ No newline at end of file