diff options
author | Daniel Schadt <kingdread@gmx.de> | 2022-12-09 21:07:20 +0100 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2022-12-09 21:15:05 +0100 |
commit | 5ab50deb4c784e8c07e8600a4a95aafb3b146f75 (patch) | |
tree | 7edb911822b9cc6bb544291a0503819e4a0ddab4 /tox.ini | |
parent | f919c404ba11886395c4669734cf11a68af4d904 (diff) | |
download | fietsboek-5ab50deb4c784e8c07e8600a4a95aafb3b146f75.tar.gz fietsboek-5ab50deb4c784e8c07e8600a4a95aafb3b146f75.tar.bz2 fietsboek-5ab50deb4c784e8c07e8600a4a95aafb3b146f75.zip |
fix tox and poetry interaction
The Poetry FAQ[1] gives some options on how tox and poetry can be used
together, since both of them want to do the virtual env managing. Since
we mostly want to use tox as a venv manager and to easily run multiple
linters, and we want to have poetry do the dependency management, the
method of explicitely using `poetry install` seems to be the most
reasonable. This means we don't have to generate a requirements.txt file
or make duplicated listings of our dependencies in tox.ini.
[1]: https://python-poetry.org/docs/master/faq/#is-tox-supported
Diffstat (limited to 'tox.ini')
-rw-r--r-- | tox.ini | 43 |
1 files changed, 21 insertions, 22 deletions
@@ -7,59 +7,58 @@ per-file-ignores = [tox] envlist = python,pylint,pylint-tests,flake8,mypy,black +# This can be removed in tox 4 as it will be the default: isolated_build = true [testenv] -deps = - pytest - lxml: lxml -extras = testing +deps = poetry +skip_install = true passenv = TERM +commands_pre = + poetry install -v --with testing commands = pytest {posargs} [testenv:pylint] -deps = pylint -usedevelop = true +commands_pre = + poetry install -v --with linters commands = pylint --rcfile=pylint.toml fietsboek [testenv:pylint-tests] -deps = pylint -usedevelop = true allowlist_externals = bash +commands_pre = + poetry install -v --with linters,testing commands = bash -c "pylint --rcfile=pylint.tests.toml tests/**/*.py" [testenv:flake8] -deps = flake8 -usedevelop = true +# This is a bit of a hack since flake8 specifies Python 3.8 as minimum required +# version, while fietsboek only specifices 3.7. Thus, we manually install +# flake8 via pip and bypass poetry's locking- +commands_pre = + poetry install -v + pip install flake8 commands = flake8 fietsboek [testenv:sphinx] -deps = sphinx -usedevelop = true allowlist_externals = make changedir={toxinidir}{/}doc +commands_pre = + poetry install -v --with docs commands = make html [testenv:mypy] -deps = - mypy - types-Markdown - types-bleach - types-babel - types-redis - types-requests -usedevelop = true +commands_pre = + poetry install --with types commands = mypy fietsboek [testenv:black] deps = black -usedevelop = true +commands_pre = commands = - black --check fietsboek + black --diff --check fietsboek |