summaryrefslogtreecommitdiff
path: root/tox.ini
diff options
context:
space:
mode:
authorBernat Gabor <bgabor8@bloomberg.net>2020-03-29 15:35:05 +0100
committerBernat Gabor <bgabor8@bloomberg.net>2020-03-30 09:55:12 +0100
commit741362fb523f48d0fd826006bc6251a85c3ec5f4 (patch)
tree2caffd43fb8acd3ab80902579524a422e1e6c098 /tox.ini
downloadtox-git-741362fb523f48d0fd826006bc6251a85c3ec5f4.tar.gz
First iteration of the rewrite4.0.0a1
Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
Diffstat (limited to 'tox.ini')
-rw-r--r--tox.ini139
1 files changed, 139 insertions, 0 deletions
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 00000000..fb838bb7
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,139 @@
+[tox]
+envlist =
+ py38
+ py35
+ py37
+ py36
+ coverage
+ fix_lint
+ package_description
+minversion = 3.14.0
+skip_missing_interpreters = true
+requires =
+ tox >= 3.14.0
+ virtualenv >= 10
+isolated_build = True
+
+[testenv]
+description = run the tests with pytest
+setenv = COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
+ VIRTUALENV_NO_DOWNLOAD = 1
+passenv = http_proxy https_proxy no_proxy SSL_CERT_FILE PYTEST_*
+deps =
+
+extras = testing
+commands = pytest --color=yes \
+ --cov "{envsitepackagesdir}/tox" \
+ --cov-config "{toxinidir}/tox.ini" \
+ --junitxml {toxworkdir}/junit.{envname}.xml \
+ {posargs:.}
+package = wheel
+
+[testenv:py34]
+deps = pip == 19.1.1
+
+[testenv:package_description]
+description = check that the long description is valid
+basepython = python3.8
+deps = twine >= 1.12.1
+ # TODO installing readme-renderer[md] should not be necessary
+ readme-renderer[md] >= 24.0
+ pip >= 18.0.0
+package = skip
+extras =
+commands = pip wheel -w {envtmpdir}/build --no-deps .
+ twine check {envtmpdir}/build/*
+
+[testenv:fix_lint]
+description = format the code base to adhere to our styles, and complain about what we cannot do automatically
+basepython = python3.8
+passenv = {[testenv]passenv}
+ # without PROGRAMDATA cloning using git for Windows will fail with an
+ # `error setting certificate verify locations` error
+ PROGRAMDATA
+extras = lint
+deps =
+ pre-commit >= 2, <3
+skip_install = true
+package = skip
+commands = pre-commit run --all-files --show-diff-on-failure {posargs}
+ python -c 'import pathlib; print("hint: run {} install to add checks as pre-commit hook".format(pathlib.Path(r"{envdir}") / "bin" / "pre-commit"))'
+
+
+[testenv:coverage]
+description = [run locally after tests]: combine coverage data and create report;
+ generates a diff coverage against origin/master (can be changed by setting DIFF_AGAINST env var)
+deps = {[testenv]deps}
+ coverage >= 4.4.1, < 5
+ diff_cover
+package = skip
+passenv = {[testenv]passenv}
+ DIFF_AGAINST
+setenv = COVERAGE_FILE={toxworkdir}/.coverage
+commands = coverage combine
+ coverage report -m
+ coverage xml -o {toxworkdir}/coverage.xml
+ coverage html -d {toxworkdir}/htmlcov
+ diff-cover --compare-branch {env:DIFF_AGAINST:origin/master} {toxworkdir}/coverage.xml
+depends = py27, py34, py35, py36, py37, pypy, pypy3
+parallel_show_output = True
+
+[flake8]
+max-complexity = 22
+max-line-length = 120
+ignore = E203, W503, C901, E402, B011
+
+[pep8]
+max-line-length = 120
+
+[coverage:run]
+branch = false
+parallel = true
+
+[coverage:report]
+skip_covered = True
+show_missing = True
+exclude_lines =
+ \#\s*pragma: no cover
+ ^\s*raise AssertionError\b
+ ^\s*raise NotImplementedError\b
+ ^\s*return NotImplemented\b
+ ^\s*raise$
+ ^if __name__ == ['"]__main__['"]:$
+
+[coverage:paths]
+source = src/tox
+ */.tox/*/lib/python*/site-packages/tox
+ */.tox/pypy*/site-packages/tox
+ */.tox\*\Lib\site-packages\tox
+ */src/tox
+ *\src\tox
+
+[pytest]
+addopts = -ra --showlocals
+rsyncdirs = tests tox
+looponfailroots = tox tests
+testpaths = tests
+junit_family = xunit2
+xfail_strict = True
+markers =
+ git
+ network
+
+[isort]
+multi_line_output = 3
+include_trailing_comma = True
+force_grid_wrap = 0
+line_length = 99
+known_first_party = tox,tests
+known_third_party = _pytest,appdirs,colorama,filelock,packaging,pluggy,psutil,py,pytest,setuptools,toml,virtualenv,wheel
+
+[testenv:dev]
+description = dev environment with all deps at {envdir}
+deps =
+ {[testenv]deps}
+ setuptools_scm >= 2.0.0, <4
+extras = testing
+usedevelop = True
+commands = python -m pip list --format=columns
+ python -c "print(r'{envpython}')"