11[tox]
2+ min_version = 4.6
23# Set the envlist:
34# Defines the environments that tox runs by default (when -e <environment> is not used)
45#
@@ -35,7 +36,6 @@ commands =
3536[testenv]
3637description = Run in a {basepython} virtualenv:
3738 cov: {[cov]description}
38- covcombine: {[covcombine]description}
3939 covcp: Copy the generated .converage and coverage.xml to the UPLOAD_DIR dir
4040 fox: {[fox]description}
4141 lint: {[lint]description}
@@ -47,27 +47,24 @@ description = Run in a {basepython} virtualenv:
4747 pytype: Run pytype for static analyis, intro: https://youtu.be/abvW0mOrDiY
4848# checkers(mypy) need the pytest dependices as well:
4949extras =
50- {check,pytype}: {[check]extras}
51- {cov,covcp,covcombine,fox,check,lint,test,pytype,pyright,mdreport}: {[test]extras}
52- {cov,covcp,covcombine,fox}: {[cov]extras}
50+ check: {[check]extras}
51+ pytype: {[pytype]extras}
52+ {lint,test,pyright,mdreport}: {[test]extras}
53+ {cov,covcp,fox}: {[cov]extras}
5354deps =
5455 mdreport: pytest-md-report
55- {py27-test,py27-cov}: pyftpdlib
56- {py27-test,py27-cov}: pylint
57- {cov,covcp,covcombine,fox}: coverage[toml]
58- {cov,covcp,covcombine,fox}: diff-cover
56+ {cov,covcp,fox}: coverage[toml]
57+ {cov,covcp,fox}: diff-cover
5958 {lint,fox}: {[lint]deps}
6059 pyright: pyright
61- pytype: {[pytype]deps}
6260allowlist_externals =
63- {cov,covcp,covcombine,fox,check,lint,test,mdreport}: echo
64- {cov,covcp,covcombine,fox,check,lint,test,mdreport}: sh
65- {cov,covcp,covcombine,fox}: cp
66- {covcombine,fox}: tox
61+ {cov,covcp,fox,check,lint,test,mdreport}: echo
62+ {cov,covcp,fox,check,lint,test,mdreport}: sh
63+ {cov,covcp,fox}: cp
6764 check: cat
6865 fox: firefox
6966passenv =
70- {pytype,covcombine, lint,test}: GITHUB_STEP_SUMMARY
67+ {pytype,lint,test}: GITHUB_STEP_SUMMARY
7168 pytype: GITHUB_SERVER_URL
7269 pytype: GITHUB_REPOSITORY
7370 pytype: GITHUB_HEAD_REF
@@ -106,20 +103,16 @@ commands =
106103 pyright: {[pyright]commands}
107104 check: {[check]commands}
108105 pytype: {[pytype]commands}
109- {cov,covcp,covcombine,check,fox,test,mdreport}: {[test]commands}
110- # covcombine shall not call [cov]commands: diff-cover shall check the combined cov:
106+ {cov,covcp,check,fox,test,mdreport}: {[test]commands}
111107 {cov,covcp}: {[cov]commands}
112- {py27-test}: pylint --py3k --disable =no-absolute-import xcp/
113108 covcp: cp -av {envlogdir}/coverage.xml {envlogdir}/coverage.lcov {envlogdir}/.coverage {envlogdir}/junit.xml {env:UPLOAD_DIR:.}
114- covcombine: {[covcombine]commands}
115- fox: {[covcombine]commands}
109+ fox: {[cov]commands}
116110 fox: {[lint]commands}
117111 fox: {[fox]commands}
118112
119113[cov]
120114description = Generate coverage html reports (incl. diff-cover) for this environment
121115setenv = PY3_DIFFCOVER_OPTIONS =--ignore-whitespace --show-uncovered
122- py27: PY3_DIFFCOVER_OPTIONS =
123116extras = coverage
124117 test
125118commands =
@@ -133,27 +126,6 @@ commands =
133126 --html-report {envlogdir}/coverage-diff.html \
134127 {envlogdir}/coverage.xml
135128
136- [covcombine]
137- description = Generate combined coverage reports with py27-test coverage merged
138- commands =
139- tox -e py27-test
140- sh -c ' export COVERAGE_FILE=$COVERAGE_FILE-combined; \
141- coverage combine --keep {envlogdir}/../../py27-test/log/.coverage {envlogdir}/.coverage;\
142- coverage xml -o {envlogdir}/coverage.xml;\
143- coverage html -d {envlogdir}/htmlcov;\
144- coverage html -d {envlogdir}/htmlcov-tests --include="tests/*"'
145- sh -c ' \
146- diff-cover --compare-branch=origin/master --ignore-staged --ignore-unstaged \
147- --ignore-whitespace --show-uncovered --fail-under {env:DIFF_COVCOMBINE_MIN:100} \
148- --html-report {envlogdir}/coverage-diff.html \
149- --markdown-report {envlogdir}/coverage-diff.md \
150- {envlogdir}/coverage.xml; EXIT_CODE=$?;echo $EXIT_CODE; \
151- GITHUB_STEP_SUMMARY={env:GITHUB_STEP_SUMMARY:.git/GITHUB_STEP_SUMMARY.md}; \
152- if [ -n "$GITHUB_STEP_SUMMARY" ]; then \
153- mkdir -p ${GITHUB_STEP_SUMMARY%/*};sed "/title/,/\/ style/d" \
154- {envlogdir}/coverage-diff.html >>"$GITHUB_STEP_SUMMARY"; fi; \
155- exit $EXIT_CODE'
156-
157129[lint]
158130description = Run pylint and fail on warnings remaining on lines in the diff to master
159131deps = pylint
@@ -168,7 +140,7 @@ commands =
168140 --html-report {envlogdir}/pylint-diff.html {envlogdir}/pylint.txt
169141
170142[fox]
171- description = Generate combined coverage html reports and open them in firefox
143+ description = Generate pylint and coverage html reports and open them in firefox
172144commands = firefox {envlogdir}/coverage-diff.html \
173145 {envlogdir}/htmlcov/index.html \
174146 {envlogdir}/htmlcov-tests/index.html \
@@ -183,7 +155,6 @@ commands = firefox {envlogdir}/coverage-diff.html
183155# the local venvs will be the same as the venvs created by tox on the GitHub runners:
184156[gh-actions]
185157python =
186- 2.7: py27
187158 3.6: py36
188159 3.7: py37
189160 3.8: py38
0 commit comments