-
-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#826] switch to source layout #827
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,47 +12,60 @@ skip_missing_interpreters = true | |
|
||
[testenv] | ||
description = run the tests with pytest under {basepython} | ||
setenv = COVERAGE_FILE={toxworkdir}/.coverage.{envname} | ||
setenv = VIRTUALENV_DOWNLOAD = 0 | ||
PIP_DISABLE_VERSION_CHECK = 1 | ||
COVERAGE_FILE = {toxworkdir}/.coverage.{envname} | ||
passenv = http_proxy https_proxy no_proxy SSL_CERT_FILE TOXENV CI TRAVIS TRAVIS_* APPVEYOR APPVEYOR_* CODECOV_* | ||
deps = setuptools >= 29.0.0 | ||
setuptools_scm >= 2.0.0, < 3 | ||
wheel >= 0.31.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It has to do with the index URL used. By default virtualenv uses PyPi. This way the tox config adheres too whatever the user has configured; e.g. value from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
either way, I don't think this boilerplate is helping you solve this issue so let's drop this or move it to another PR |
||
extras = testing | ||
commands = pytest {posargs:--cov-config="{toxinidir}/tox.ini" --cov="{envsitepackagesdir}/tox" --timeout=180 tests} | ||
changedir = {toxinidir}/tests | ||
commands = pytest {posargs:--cov="{envsitepackagesdir}/tox" --cov-config="{toxinidir}/tox.ini" --timeout=180 .} | ||
|
||
[testenv:docs] | ||
description = invoke sphinx-build to build the HTML docs and check that all links are valid | ||
whitelist_externals = sphinx-build | ||
basepython = python3.6 | ||
extras = docs | ||
changedir = {toxinidir} | ||
commands = sphinx-build -d "{toxworkdir}/docs_doctree" doc "{toxworkdir}/docs_out" --color -W -bhtml | ||
|
||
|
||
[testenv:fix-lint] | ||
description = run static analysis and style check using flake8 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. heh, description isn't exactly right |
||
basepython = python3.6 | ||
passenv = {[testenv]passenv} | ||
HOMEPATH | ||
# without PROGRAMDATA cloning using git for Windows will fail with an | ||
# `error setting certificate verify locations` error | ||
PROGRAMDATA | ||
extras = lint | ||
description = run static analysis and style check using flake8 | ||
changedir = {toxinidir} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. heh, |
||
commands = pre-commit run --all-files --show-diff-on-failure | ||
python -c 'print("hint: run {envdir}/bin/pre-commit install to add checks as pre-commit hook")' | ||
|
||
|
||
[testenv:coverage] | ||
description = combine coverage data and create reports | ||
deps = 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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well spotted, fixed |
||
deps = {[testenv]deps} | ||
coverage >= 4.4.1, < 5 | ||
diff_cover | ||
skip_install = True | ||
changedir = {toxworkdir} | ||
setenv = COVERAGE_FILE=.coverage | ||
setenv = COVERAGE_FILE={toxworkdir}/.coverage | ||
changedir = {toxinidir} | ||
commands = coverage erase | ||
coverage combine | ||
coverage report --rcfile="{toxinidir}/tox.ini" | ||
coverage xml | ||
coverage report -m | ||
coverage xml -o {toxworkdir}/coverage.xml | ||
diff-cover --compare-branch {env:DIFF_AGAINST:origin/master} {toxworkdir}/coverage.xml | ||
|
||
[testenv:codecov] | ||
description = [only run on CI]: upload coverage data to codecov (depends on coverage running first) | ||
deps = codecov | ||
skip_install = True | ||
changedir = {toxinidir} | ||
commands = codecov --file "{toxworkdir}/coverage.xml" | ||
|
||
[testenv:exit_code] | ||
|
@@ -61,13 +74,15 @@ commands = codecov --file "{toxworkdir}/coverage.xml" | |
basepython = python3.6 | ||
description = commands with several exit codes | ||
skip_install = True | ||
changedir = {toxinidir} | ||
commands = python3.6 -c "import sys; sys.exit(139)" | ||
|
||
[testenv:pra] | ||
platform = linux | ||
passenv = * | ||
description = "personal release assistant" - see HOWTORELEASE.rst | ||
extras = publish, docs | ||
changedir = {toxinidir} | ||
commands = sphinx-build -d "{toxworkdir}/docs_doctree" doc "{toxworkdir}/docs_out" --color -W -blinkcheck | ||
"{toxinidir}/tasks/pra.sh" {posargs} | ||
|
||
|
@@ -81,6 +96,7 @@ extras = testing, docs | |
# required to make looponfail reload on every source code change | ||
usedevelop = True | ||
basepython = python3.6 | ||
changedir = {toxinidir} | ||
commands = python -m pip list --format=columns | ||
python -c 'import sys; print(sys.executable)' | ||
|
||
|
@@ -90,21 +106,21 @@ max-line-length = 99 | |
ignore = E203, W503 | ||
|
||
[coverage:run] | ||
omit = tox/__main__.py | ||
branch = false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. branch coverage is useful! please don't turn it off! |
||
|
||
[coverage:report] | ||
skip_covered = True | ||
show_missing = True | ||
exclude_lines = if __name__ == ["']__main__["']: | ||
|
||
[coverage:paths] | ||
source = tox | ||
{toxworkdir}/*/lib/python*/site-packages/tox | ||
{toxworkdir}/*/Lib/site-packages/tox | ||
{toxworkdir}/pypy*/site-packages/tox | ||
source = src/tox | ||
.tox/*/lib/python*/site-packages/tox | ||
.tox/*/Lib/site-packages/tox | ||
.tox/pypy*/site-packages/tox | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is by far my least favorite part of moving to a we've used this script or a derivative of it to try and make this more sane (it combines the coverage data from site-packages over top the local directory) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm, combining the data is still fine (e.g. |
||
|
||
[pytest] | ||
addopts = -rsxX -vvv --showlocals | ||
addopts = -rsxX --showlocals | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok :) |
||
rsyncdirs = tests tox | ||
looponfailroots = tox tests | ||
norecursedirs = .hg .tox | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've usually seen this written as
VIRTUALENV_NO_DOWNLOAD=1