Skip to content

Commit

Permalink
tox.ini updates based on tox-dev/tox
Browse files Browse the repository at this point in the history
  • Loading branch information
luizirber committed Aug 5, 2020
1 parent 63411e1 commit b5aefe5
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 25 deletions.
10 changes: 0 additions & 10 deletions .coveragerc

This file was deleted.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ git_describe_command = "git describe --dirty --tags --long --match v* --first-pa
known_third_party = ["deprecation", "hypothesis", "mmh3", "numpy", "pkg_resources", "pytest", "screed", "setuptools", "sourmash_tst_utils"]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
line_length = 88
known_first_party = ["sourmash"]
81 changes: 66 additions & 15 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,38 @@ envlist =
py36,
py35,
# fix_lint,
minversion = 3.12
isolated_build = true
skip_missing_interpreters = true

[testenv]
description = run the tests with pytest under {basepython}
setenv = PIP_DISABLE_VERSION_CHECK = 1
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
VIRTUALENV_NO_DOWNLOAD = 1
passenv = http_proxy https_proxy no_proxy SSL_CERT_FILE PYTEST_* CI TRAVIS TRAVIS_* PYTHONDEVMODE
setenv =
PIP_DISABLE_VERSION_CHECK = 1
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
VIRTUALENV_NO_DOWNLOAD = 1
passenv =
CURL_CA_BUNDLE
http_proxy
https_proxy
no_proxy
REQUESTS_CA_BUNDLE
SSL_CERT_FILE
PYTEST_*
PIP_CACHE_DIR
CI
TRAVIS
TRAVIS_*
PYTHONDEVMODE
deps =
pip>=19.3.1
pip>=19.3.1
extras =
test
10x
storage
test
10x
storage
changedir = tests
commands = pytest --basetemp="{envtmpdir}" \
commands = pytest \
--basetemp="{envtmpdir}" \
--cov "{envsitepackagesdir}/sourmash" \
--cov-config "{toxinidir}/tox.ini" \
--junitxml {toxworkdir}/junit.{envname}.xml \
Expand Down Expand Up @@ -69,17 +84,18 @@ passenv = {[testenv]passenv}
# without PROGRAMDATA cloning using git for Windows will fail with an
# `error setting certificate verify locations` error
PROGRAMDATA
PRE_COMMIT_HOME
extras = lint
deps = pre-commit >= 1.14.4, < 2
deps = pre-commit>=2
skip_install = True
commands = pre-commit run --all-files --show-diff-on-failure
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)
generates a diff coverage against origin/latest (can be changed by setting DIFF_AGAINST env var)
deps = {[testenv]deps}
coverage >= 5, < 6
coverage >= 5.0.1, < 6
diff_cover
skip_install = True
passenv = {[testenv]passenv}
Expand All @@ -89,8 +105,8 @@ 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
diff-cover --compare-branch {env:DIFF_AGAINST:origin/latest} {toxworkdir}/coverage.xml
depends = py38, py37, py36, py35, pypy3
parallel_show_output = True

[testenv:codecov]
Expand All @@ -103,18 +119,53 @@ changedir = {toxinidir}
depends = coverage
commands = codecov --file "{toxworkdir}/coverage.xml" {posargs}

[testenv:X]
description = print the positional arguments passed in with echo
commands = echo {posargs}

[coverage:run]
branch = true
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 = sourmash/
*/.tox/*/lib/python*/site-packages/sourmash
*/.tox/pypy*/site-packages/sourmash
*/.tox\*\Lib\site-packages\sourmash
*/sourmash
*\sourmash
[travis]
python =
3.7: py37, docs, package_description
[flake8]
max-complexity = 22
max-line-length = 99
ignore = E203, W503, C901, E402
ignore = E203, W503, C901, E402, B011
[pep8]
max-line-length = 99
[testenv:dev]
description = dev environment with all deps at {envdir}
extras =
test
10x
storage
doc
deps = {[testenv]deps}
usedevelop = True
commands = python -m pip list --format=columns
python -c "print(r'{envpython}')"

0 comments on commit b5aefe5

Please sign in to comment.