Skip to content

Commit

Permalink
Update tox.ini and pyproject.toml
Browse files Browse the repository at this point in the history
- Remove outdated python environments
- Change dependency mechanism to poetry
- Remove flake8 which was replaced with ruff

Closes #204.
  • Loading branch information
shoeffner committed Jul 22, 2024
1 parent 3b6fe06 commit ae477ab
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 153 deletions.
15 changes: 0 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,3 @@ show_missing = true

[tool.radon]
cc_min = "B"

[tool.flake8]
max-line-length = 88
ignore = ["E129", "E203", "E501", "W503", "S101"]
exclude = [".tox", ".egg", "conf.py", "conftest.py"]

[tool.pylint]
max-line-length = 88

[tool.pylama.pycodestyle]
max_line_length = 88

[tool.pylama.pylint]
max_line_length = 88
disable = "R"
192 changes: 54 additions & 138 deletions tox.ini
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/

0 comments on commit ae477ab

Please sign in to comment.