Move Tox tool config settings to pyproject.toml

This commit is contained in:
Peter Bittner 2022-01-09 05:22:49 +01:00
parent 051d46ceda
commit f8d75b04a0
4 changed files with 49 additions and 28 deletions

View file

@ -1 +0,0 @@
tox.ini

1
.gitignore vendored
View file

@ -4,6 +4,7 @@
/.tox
/.coverage
/coverage.xml
/tests/reports
/build
/dist

26
pyproject.toml Normal file
View file

@ -0,0 +1,26 @@
[tool.bandit]
exclude = [
".git",
".idea",
".tox",
"build",
"dist",
"docs",
"tests",
]
[tool.black]
color = true
[tool.coverage.xml]
output = "tests/reports/coverage.xml"
[tool.isort]
color_output = true
profile = "black"
[tool.pylint.master]
output-format = "colorized"
[tool.pytest.ini_options]
addopts = "--junitxml=tests/reports/unittests.xml --color=yes --verbose"

49
tox.ini
View file

@ -18,47 +18,32 @@ deps =
django22: Django>=2.2,<3.0
django32: Django>=3.2,<4.0
django40: Django>=4.0a1,<4.1
commands =
coverage run -m pytest
coverage xml
[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310
[gh-actions:env]
DJANGO =
2.2: django22
3.2: django32
4.0: django40
[testenv:bandit]
description = PyCQA security linter
deps = bandit<1.6
commands = - bandit -r --ini tox.ini
deps = bandit
commands = - bandit {posargs:-r analytical setup.py}
ignore_errors = true
[testenv:docs]
description = Build the HTML documentation
deps = sphinx
commands = sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
whitelist_externals = make
allowlist_externals = make
[testenv:flake8]
description = Static code analysis and code style
deps = flake8
commands = flake8
commands = flake8 {posargs}
[testenv:isort]
description = Ensure imports are ordered
description = Ensure imports are ordered consistently
deps = isort[colors]
commands = isort --check-only --diff {posargs:analytical setup.py tests}
skip_install = True
deps = isort
commands = isort tests setup.py analytical --check --diff
[testenv:readme]
description = Ensure README renders on PyPI
@ -73,13 +58,23 @@ deps = pyclean
commands =
pyclean -v {toxinidir}
rm -rf .tox/ build/ dist/ django_analytical.egg-info/ .coverage coverage.xml
whitelist_externals =
allowlist_externals =
rm
[bandit]
exclude = .cache,.git,.tox,build,dist,docs,tests
targets = .
[flake8]
exclude = .cache,.git,.tox,build,dist
max-line-length = 100
[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310
[gh-actions:env]
DJANGO =
2.2: django22
3.2: django32
4.0: django40