From 918f0db538a3bf82e9fb85238b65409e08f15602 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Wed, 9 Oct 2024 14:26:23 +0200 Subject: [PATCH 1/3] Use `skip_install=true` for tox.ini dev environment so that the package itself is not installed into the site packages which is rather annoying to debug --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 3672f01..c45a169 100644 --- a/tox.ini +++ b/tox.ini @@ -81,6 +81,7 @@ deps = .[formatting] .[dev] pre-commit +skip_install=true commands = python -m pip install --upgrade pip pip install -r requirements.txt From a64a78d0eba247025a742fef363084b3095951ea Mon Sep 17 00:00:00 2001 From: Konstantin Date: Thu, 10 Oct 2024 08:43:43 +0200 Subject: [PATCH 2/3] wip --- tox.ini | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tox.ini b/tox.ini index c45a169..35cba45 100644 --- a/tox.ini +++ b/tox.ini @@ -14,7 +14,7 @@ commands = python -m pip install --upgrade pip # the tests environment is called by the Github action that runs the unit tests deps = -r requirements.txt - .[tests] +extras = tests setenv = PYTHONPATH = {toxinidir}/src commands = python -m pytest --basetemp={envtmpdir} {posargs} @@ -22,7 +22,7 @@ commands = python -m pytest --basetemp={envtmpdir} {posargs} # the linting environment is called by the Github Action that runs the linter deps = {[testenv:tests]deps} - .[linting] +extras = linting # add your fixtures like e.g. pytest_datafiles here setenv = PYTHONPATH = {toxinidir}/src commands = @@ -35,7 +35,7 @@ commands = setenv = PYTHONPATH = {toxinidir}/src deps = {[testenv:tests]deps} - .[type_check] +extras = type_check commands = mypy --show-error-codes src/mypackage --strict mypy --show-error-codes unittests --strict @@ -46,7 +46,7 @@ commands = setenv = PYTHONPATH = {toxinidir}/src deps = -r requirements.txt - .[spell_check] +extras = spell_check commands = codespell --ignore-words=domain-specific-terms.txt src codespell --ignore-words=domain-specific-terms.txt README.md @@ -57,7 +57,7 @@ commands = changedir = unittests deps = {[testenv:tests]deps} - .[coverage] +extras = coverage setenv = PYTHONPATH = {toxinidir}/src commands = coverage run -m pytest --basetemp={envtmpdir} {posargs} @@ -78,9 +78,8 @@ deps = {[testenv:type_check]deps} {[testenv:coverage]deps} {[testenv:spell_check]deps} - .[formatting] - .[dev] pre-commit +extras = formatting, dev skip_install=true commands = python -m pip install --upgrade pip @@ -89,8 +88,7 @@ commands = [testenv:test_packaging] skip_install = true -deps = - .[packaging] +extras = packaging commands = python -m build twine check dist/* From def730a51da7d15e785bc3a26ab6764cbe7a50d6 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Thu, 10 Oct 2024 08:49:38 +0200 Subject: [PATCH 3/3] wip --- tox.ini | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 35cba45..d09644d 100644 --- a/tox.ini +++ b/tox.ini @@ -23,7 +23,7 @@ commands = python -m pytest --basetemp={envtmpdir} {posargs} deps = {[testenv:tests]deps} extras = linting - # add your fixtures like e.g. pytest_datafiles here +allowlist_externals = pylint setenv = PYTHONPATH = {toxinidir}/src commands = pylint mypackage @@ -36,6 +36,7 @@ setenv = PYTHONPATH = {toxinidir}/src deps = {[testenv:tests]deps} extras = type_check +allowlist_externals = mypy commands = mypy --show-error-codes src/mypackage --strict mypy --show-error-codes unittests --strict @@ -47,6 +48,7 @@ setenv = PYTHONPATH = {toxinidir}/src deps = -r requirements.txt extras = spell_check +allowlist_externals = codespell commands = codespell --ignore-words=domain-specific-terms.txt src codespell --ignore-words=domain-specific-terms.txt README.md @@ -58,6 +60,7 @@ changedir = unittests deps = {[testenv:tests]deps} extras = coverage +allowlist_externals = coverage setenv = PYTHONPATH = {toxinidir}/src commands = coverage run -m pytest --basetemp={envtmpdir} {posargs}