273 lines
6.0 KiB
INI
273 lines
6.0 KiB
INI
[tox]
|
|
envlist =
|
|
py{26,27,33,34,35,36,37},
|
|
bandit, doc8, readme,
|
|
mypy-py{2,3},
|
|
flake8, pylint,
|
|
flake8-tests, pylint-tests,
|
|
# prone to false positives
|
|
vulture
|
|
|
|
# Additional environments:
|
|
# linters :: Runs all linters over all source code.
|
|
# linters-tests :: Runs all linters over all tests.
|
|
|
|
[testenv:default-python]
|
|
basepython = python3
|
|
|
|
[testenv:base-command]
|
|
commands = pytest --basetemp={envtmpdir} -l --cov base64io {posargs}
|
|
|
|
[testenv]
|
|
sitepackages = False
|
|
deps =
|
|
py26: -rtest/requirements/legacy
|
|
py27: -rtest/requirements/modern
|
|
py33: -rtest/requirements/legacy
|
|
py34: -rtest/requirements/modern
|
|
py35: -rtest/requirements/modern
|
|
py36: -rtest/requirements/modern
|
|
py37: -rtest/requirements/modern
|
|
commands = pytest --basetemp={envtmpdir} -l --cov base64io {posargs}
|
|
|
|
# mypy
|
|
[testenv:mypy-common]
|
|
basepython = {[testenv:default-python]basepython}
|
|
deps =
|
|
coverage
|
|
mypy
|
|
mypy_extensions
|
|
typing>=3.6.2
|
|
commands =
|
|
python -m mypy \
|
|
--linecoverage-report build \
|
|
src/base64io/
|
|
|
|
[testenv:mypy-coverage]
|
|
commands =
|
|
# Make mypy linecoverage report readable by coverage
|
|
python -c \
|
|
"t = open('.coverage', 'w');\
|
|
c = open('build/coverage.json').read();\
|
|
t.write('!coverage.py: This is a private format, don\'t read it directly!\n');\
|
|
t.write(c);\
|
|
t.close()"
|
|
coverage report -m
|
|
|
|
[testenv:mypy-py3]
|
|
basepython = {[testenv:mypy-common]basepython}
|
|
deps = {[testenv:mypy-common]deps}
|
|
commands =
|
|
{[testenv:mypy-common]commands}
|
|
{[testenv:mypy-coverage]commands}
|
|
|
|
[testenv:mypy-py2]
|
|
basepython = {[testenv:mypy-common]basepython}
|
|
deps = {[testenv:mypy-common]deps}
|
|
commands =
|
|
{[testenv:mypy-common]commands} --py2
|
|
{[testenv:mypy-coverage]commands}
|
|
|
|
# Linters
|
|
[testenv:flake8]
|
|
basepython = {[testenv:default-python]basepython}
|
|
deps =
|
|
flake8
|
|
flake8-docstrings
|
|
flake8-import-order
|
|
# https://github.com/JBKahn/flake8-print/pull/30
|
|
flake8-print>=3.1.0
|
|
commands =
|
|
flake8 \
|
|
src/base64io/ \
|
|
setup.py \
|
|
doc/conf.py
|
|
|
|
[testenv:flake8-tests]
|
|
basepython = {[testenv:flake8]basepython}
|
|
deps = {[testenv:flake8]deps}
|
|
commands =
|
|
flake8 \
|
|
# Ignore F811 redefinition errors in tests (breaks with pytest-mock use)
|
|
# Ignore D103 docstring requirements for tests
|
|
--ignore F811,D103 \
|
|
test/
|
|
|
|
[testenv:blacken-src]
|
|
basepython = python3
|
|
deps =
|
|
black
|
|
commands =
|
|
black --line-length 120 \
|
|
src/base64io/ \
|
|
setup.py \
|
|
doc/conf.py \
|
|
test/
|
|
|
|
[testenv:blacken-docs]
|
|
basepython = python3
|
|
deps =
|
|
blacken-docs
|
|
commands =
|
|
blacken-docs --line-length 90 \
|
|
README.rst
|
|
|
|
|
|
[testenv:blacken]
|
|
basepython = python3
|
|
deps =
|
|
{[testenv:blacken-src]deps}
|
|
{[testenv:blacken-docs]deps}
|
|
commands =
|
|
{[testenv:blacken-src]commands}
|
|
{[testenv:blacken-docs]commands}
|
|
|
|
[testenv:black-check]
|
|
basepython = python3
|
|
deps =
|
|
{[testenv:blacken]deps}
|
|
commands =
|
|
{[testenv:blacken-src]commands} --diff
|
|
|
|
[testenv:isort-seed]
|
|
basepython = python3
|
|
deps = seed-isort-config
|
|
commands = seed-isort-config
|
|
|
|
[testenv:isort]
|
|
basepython = python3
|
|
deps = isort
|
|
commands = isort -rc \
|
|
src \
|
|
test \
|
|
doc \
|
|
setup.py \
|
|
{posargs}
|
|
|
|
[testenv:isort-check]
|
|
basepython = python3
|
|
deps = {[testenv:isort]deps}
|
|
commands = {[testenv:isort]commands} -c
|
|
|
|
[testenv:autoformat]
|
|
basepython = python3
|
|
deps =
|
|
{[testenv:blacken]deps}
|
|
{[testenv:isort]deps}
|
|
commands =
|
|
{[testenv:blacken]commands}
|
|
{[testenv:isort]commands}
|
|
|
|
[testenv:pylint]
|
|
basepython = {[testenv:default-python]basepython}
|
|
deps =
|
|
-rtest/requirements/modern
|
|
pyflakes
|
|
pylint
|
|
commands =
|
|
pylint \
|
|
--rcfile=src/pylintrc \
|
|
src/base64io/ \
|
|
setup.py \
|
|
doc/conf.py
|
|
|
|
[testenv:pylint-tests]
|
|
basepython = {[testenv:pylint]basepython}
|
|
deps = {[testenv:pylint]deps}
|
|
commands =
|
|
pylint \
|
|
--rcfile=test/pylintrc \
|
|
test/unit/
|
|
|
|
[testenv:doc8]
|
|
basepython = {[testenv:default-python]basepython}
|
|
deps =
|
|
sphinx
|
|
doc8
|
|
commands = doc8 doc/index.rst README.rst CHANGELOG.rst
|
|
|
|
[testenv:readme]
|
|
basepython = {[testenv:default-python]basepython}
|
|
deps = readme_renderer
|
|
commands = python setup.py check -r -s
|
|
|
|
[testenv:bandit]
|
|
basepython = {[testenv:default-python]basepython}
|
|
deps = bandit
|
|
commands = bandit -r src/base64io/
|
|
|
|
# Prone to false positives: only run independently
|
|
[testenv:vulture]
|
|
basepython = {[testenv:default-python]basepython}
|
|
deps = vulture
|
|
commands = vulture src/base64io/
|
|
|
|
[testenv:linters]
|
|
basepython = {[testenv:default-python]basepython}
|
|
deps =
|
|
{[testenv:flake8]deps}
|
|
{[testenv:pylint]deps}
|
|
{[testenv:doc8]deps}
|
|
{[testenv:readme]deps}
|
|
{[testenv:bandit]deps}
|
|
commands =
|
|
{[testenv:flake8]commands}
|
|
{[testenv:pylint]commands}
|
|
{[testenv:doc8]commands}
|
|
{[testenv:readme]commands}
|
|
{[testenv:bandit]commands}
|
|
|
|
[testenv:linters-tests]
|
|
basepython = {[testenv:default-python]basepython}
|
|
deps =
|
|
{[testenv:flake8-tests]deps}
|
|
{[testenv:pylint-tests]deps}
|
|
commands =
|
|
{[testenv:flake8-tests]commands}
|
|
{[testenv:pylint-tests]commands}
|
|
|
|
# Documentation
|
|
[testenv:docs]
|
|
basepython = {[testenv:default-python]basepython}
|
|
deps = -rdoc/requirements.txt
|
|
commands =
|
|
sphinx-build -E -c doc/ -b html doc/ doc/build/html
|
|
|
|
[testenv:serve-docs]
|
|
basepython = {[testenv:default-python]basepython}
|
|
skip_install = true
|
|
changedir = doc/build/html
|
|
deps =
|
|
commands =
|
|
python -m http.server {posargs}
|
|
|
|
# Release tooling
|
|
[testenv:build]
|
|
basepython = {[testenv:default-python]basepython}
|
|
skip_install = true
|
|
deps =
|
|
wheel
|
|
setuptools
|
|
commands =
|
|
python setup.py sdist bdist_wheel
|
|
|
|
[testenv:test-release]
|
|
basepython = {[testenv:default-python]basepython}
|
|
skip_install = true
|
|
deps =
|
|
{[testenv:build]deps}
|
|
twine
|
|
commands =
|
|
{[testenv:build]commands}
|
|
twine upload --skip-existing --repository testpypi dist/*
|
|
|
|
[testenv:release]
|
|
basepython = {[testenv:default-python]basepython}
|
|
skip_install = true
|
|
deps =
|
|
{[testenv:build]deps}
|
|
twine
|
|
commands =
|
|
{[testenv:build]commands}
|
|
twine upload --skip-existing --repository pypi dist/*
|