-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #205 from shoeffner/update-tox
Update tox.ini and pyproject.toml
- Loading branch information
Showing
2 changed files
with
54 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,196 +1,112 @@ | ||
[tox] | ||
envlist = py36,py37,py38,coverage,coveralls,docs,packaging,dist_install | ||
requires = | ||
tox>=4 | ||
envlist = py3,py3{8,9,10,11,12},coverage,coveralls,lint | ||
skip_missing_interpreters = True | ||
ignore_basepython_conflict = True | ||
|
||
[testenv] | ||
description = default settings for unspecified tests | ||
usedevelop = False | ||
skip_install = False | ||
skip_install = True | ||
allowlist_externals = poetry | ||
passenv = * | ||
basepython = python3.6 | ||
|
||
[testenv:py36] | ||
deps = | ||
-r{toxinidir}/requirements/tests.txt | ||
commands_pre = | ||
poetry lock --no-update | ||
poetry install --with=tests | ||
commands = | ||
pytest -v tests/ --cov=pyDataverse --basetemp={envtmpdir} | ||
pytest -v tests --cov=pyDataverse --basetemp={envtmpdir} | ||
|
||
[testenv:py37] | ||
basepython = python3.7 | ||
deps = | ||
-r{toxinidir}/requirements/tests.txt | ||
commands = | ||
pytest -v tests/ --cov=pyDataverse --basetemp={envtmpdir} | ||
[testenv:py3] | ||
|
||
[testenv:py38] | ||
basepython = python3.8 | ||
deps = | ||
-r{toxinidir}/requirements/tests.txt | ||
commands = | ||
pytest -v tests/ --cov=pyDataverse --basetemp={envtmpdir} | ||
|
||
[testenv:py39] | ||
basepython = python3.9 | ||
|
||
[testenv:py310] | ||
basepython = python3.10 | ||
|
||
[testenv:py311] | ||
basepython = python3.11 | ||
|
||
[testenv:py312] | ||
basepython = python3.12 | ||
|
||
[testenv:py313] | ||
basepython = python3.13 | ||
|
||
[testenv:coverage] | ||
description = create report for coverage | ||
deps = | ||
-r{toxinidir}/requirements/tests.txt | ||
commands = | ||
pytest tests/ --cov=pyDataverse --cov-report=term-missing --cov-report=xml --cov-report=html | ||
pytest tests --cov=pyDataverse --cov-report=term-missing --cov-report=xml --cov-report=html | ||
|
||
[testenv:coveralls] | ||
description = create reports for coveralls | ||
deps = | ||
-r{toxinidir}/requirements/tests.txt | ||
commands = | ||
pytest tests/ --doctest-modules -v --cov=pyDataverse | ||
pytest tests --doctest-modules -v --cov=pyDataverse | ||
|
||
[testenv:pylint] | ||
description = pylint for linting | ||
deps = | ||
-r{toxinidir}/requirements/lint.txt | ||
[testenv:lint] | ||
commands_pre = | ||
poetry lock --no-update | ||
poetry install --with=lint | ||
commands = | ||
pylint pyDataverse/ | ||
pylint tests/ | ||
ruff check pyDataverse tests | ||
|
||
[testenv:mypy] | ||
deps = | ||
-r{toxinidir}/requirements/lint.txt | ||
commands = | ||
mypy pyDataverse/ setup.py tests/ | ||
|
||
[flake8] | ||
max-line-length = 80 | ||
ignore = E129 | ||
exclude = | ||
pyDataverse/docs/source/conf.py | ||
.tox | ||
.egg | ||
|
||
[testenv:flake8] | ||
description = flake8 for style guide and docstring testing | ||
deps = | ||
-r{toxinidir}/requirements/lint.txt | ||
commands = | ||
pip uninstall -y flake8-pytest-style | ||
pip uninstall -y flake8-rst-docstrings | ||
flake8 pyDataverse/ | ||
|
||
[testenv:flake8_docs] | ||
description = flake8 for style guide and docstring testing | ||
deps = | ||
-r{toxinidir}/requirements/lint.txt | ||
commands = | ||
pip uninstall -y flake8-blind-except | ||
pip uninstall -y flake8-builtins | ||
pip uninstall -y flake8-bandit | ||
pip uninstall -y flake8-breakpoint | ||
pip uninstall -y flake8-bugbear | ||
pip uninstall -y flake8-comprehensions | ||
pip uninstall -y flake8-requirements | ||
pip uninstall -y flake8-return | ||
flake8 --docstring-convention numpy pyDataverse/ | ||
flake8 --docstring-convention numpy tests/ | ||
|
||
[testenv:flake8_tests] | ||
description = flake8 for style guide and docstring testing | ||
deps = | ||
-r{toxinidir}/requirements/lint.txt | ||
commands = | ||
flake8 tests/ | ||
|
||
[testenv:black] | ||
description = black for auto-formatting | ||
deps = | ||
-r{toxinidir}/requirements/lint.txt | ||
commands = | ||
black pyDataverse/ | ||
black tests/ | ||
|
||
[testenv:pre-commit] | ||
deps = pre-commit | ||
commands_pre = | ||
poetry lock --no-update | ||
poetry install --with=lint | ||
commands = | ||
pre-commit run --all-files | ||
mypy pyDataverse tests | ||
|
||
[testenv:docs] | ||
description = invoke sphinx-build to build the HTML docs | ||
deps = | ||
-r{toxinidir}/requirements/docs.txt | ||
commands_pre = | ||
poetry lock --no-update | ||
poetry install --with=docs | ||
commands = | ||
sphinx-build -d pyDataverse/docs/build/docs_doctree pyDataverse/docs/source docs/build/html --color -b html {posargs} | ||
|
||
[testenv:pydocstyle] | ||
description = pydocstyle for auto-formatting | ||
deps = | ||
-r{toxinidir}/requirements/docs.txt | ||
commands_pre = | ||
poetry lock --no-update | ||
poetry install --with=docs | ||
commands = | ||
pydocstyle pyDataverse/ | ||
pydocstyle tests/ | ||
|
||
[testenv:packaging] | ||
description = check packaging with twine | ||
skip_install = True | ||
recreate = True | ||
deps = | ||
-r{toxinidir}/requirements/packaging.txt | ||
commands = | ||
# rm -R {toxinidir}/pyDataverse.egg-info | ||
# rm -R {toxinidir}/dist | ||
# rm -R {toxinidir}/build | ||
python setup.py sdist bdist_wheel | ||
twine check dist/* | ||
|
||
[testenv:dist_install] | ||
description = install from dist | ||
recreate = True | ||
commands = | ||
pip freeze | ||
python -c "import pyDataverse; print(pyDataverse.__name__); print(pyDataverse.__version__)" | ||
|
||
[testenv:pypitest] | ||
description = install from test pypi | ||
skip_install = True | ||
recreate = True | ||
commands = | ||
pip install --index-url https://test.pypi.org/simple/ pyDataverse | ||
pip freeze | ||
python -c "import pyDataverse; print(pyDataverse.__name__); print(pyDataverse.__version__)" | ||
|
||
[testenv:pypi] | ||
description = install from pypi | ||
skip_install = True | ||
recreate = True | ||
commands = | ||
pip install pyDataverse | ||
pip freeze | ||
python -c "import pyDataverse; print(pyDataverse.__name__); print(pyDataverse.__version__)" | ||
|
||
[testenv:radon-mc] | ||
description = Radon McCabe number | ||
deps = | ||
-r{toxinidir}/requirements/lint.txt | ||
commands_pre = | ||
poetry lock --no-update | ||
poetry install --with=lint | ||
commands = | ||
radon cc pyDataverse/ -a | ||
|
||
[testenv:radon-mi] | ||
description = Radon Maintainability Index | ||
deps = | ||
-r{toxinidir}/requirements/lint.txt | ||
commands_pre = | ||
poetry lock --no-update | ||
poetry install --with=lint | ||
commands = | ||
radon mi pyDataverse/ | ||
radon mi tests/ | ||
|
||
[testenv:radon-raw] | ||
description = Radon raw metrics | ||
deps = | ||
-r{toxinidir}/requirements/lint.txt | ||
commands_pre = | ||
poetry lock --no-update | ||
poetry install --with=lint | ||
commands = | ||
radon raw pyDataverse/ | ||
radon raw tests/ | ||
|
||
[testenv:radon-hal] | ||
description = Radon Halstead metrics | ||
deps = | ||
-r{toxinidir}/requirements/lint.txt | ||
commands_pre = | ||
poetry lock --no-update | ||
poetry install --with=lint | ||
commands = | ||
radon hal pyDataverse/ | ||
radon hal tests/ |