2022-07-12 14:31:23 +02:00
|
|
|
[tox]
|
2023-03-01 16:59:02 +01:00
|
|
|
envlist = lint, mypy, py{37,38,39,310}
|
2022-07-12 14:31:23 +02:00
|
|
|
skip_missing_interpreters = True
|
|
|
|
|
|
|
|
[testenv]
|
2022-07-13 16:04:49 +02:00
|
|
|
deps =
|
|
|
|
pytest
|
|
|
|
pytest-mock
|
2022-07-12 14:31:23 +02:00
|
|
|
commands =
|
|
|
|
pytest {toxinidir}/check_patroni {toxinidir}/tests {posargs:-vv}
|
|
|
|
|
|
|
|
[testenv:lint]
|
|
|
|
skip_install = True
|
|
|
|
deps =
|
2023-03-01 17:08:04 +01:00
|
|
|
codespell
|
2022-07-12 14:31:23 +02:00
|
|
|
black
|
|
|
|
flake8
|
|
|
|
commands =
|
2023-03-01 17:08:04 +01:00
|
|
|
codespell {toxinidir}/check_patroni {toxinidir}/tests
|
2022-07-12 14:31:23 +02:00
|
|
|
black --check --diff {toxinidir}/check_patroni {toxinidir}/tests
|
|
|
|
flake8 {toxinidir}/check_patroni {toxinidir}/tests
|
|
|
|
|
|
|
|
[testenv:mypy]
|
|
|
|
deps =
|
|
|
|
mypy == 0.961
|
|
|
|
commands =
|
2023-03-12 19:43:06 +01:00
|
|
|
# we need to install types-requests
|
|
|
|
mypy --install-types --non-interactive {toxinidir}/check_patroni
|
2022-07-13 16:04:49 +02:00
|
|
|
|
|
|
|
[testenv:build]
|
|
|
|
deps =
|
|
|
|
wheel
|
|
|
|
setuptools
|
|
|
|
twine
|
|
|
|
allowlist_externals =
|
|
|
|
rm
|
|
|
|
commands =
|
|
|
|
rm --verbose --recursive --force {toxinidir}/dist/
|
|
|
|
python setup.py check
|
|
|
|
python setup.py sdist bdist_wheel
|
|
|
|
python -m twine check dist/*
|
|
|
|
|
|
|
|
[testenv:upload]
|
|
|
|
# requires a check_patroni section in ~/.pypirc
|
|
|
|
skip_install = True
|
|
|
|
deps =
|
|
|
|
twine
|
|
|
|
commands =
|
|
|
|
python -m twine upload --repository check_patroni dist/*
|