Skip to content

Commit

Permalink
Modification in tox.ini
Browse files Browse the repository at this point in the history
* move flake8 to a more generic lint / linter section and make that useable with Python 2 & 3
* introduce constraints.txt which for the start is empty, but could be used to pin / or exclude bad versions.
  • Loading branch information
loechel committed Sep 18, 2017
1 parent 9922e72 commit 87937be
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 19 deletions.
3 changes: 3 additions & 0 deletions constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Constraints for Python Packages
# -----------------------------------------------
# Pin Versions / Version Ranges if necessary.
92 changes: 73 additions & 19 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ envlist =
py35,
py36,
py36-datetime,
pypy,
docs,
isort,
flake8,
lint-py2,
lint-py3,
coverage,

skip_missing_interpreters = False
Expand All @@ -20,71 +21,124 @@ extras =
test

commands =
pytest --cov=src --cov-report=xml --html=reports/pytest/report-{envname}.html --doctest-glob=*.rst --self-contained-html {posargs}
pytest --cov=src --cov-report=xml --html=reports/pytest/report-{envname}.html --self-contained-html {posargs}
pytest --doctest-modules src/RestrictedPython/compile.py {posargs}

setenv =
COVERAGE_FILE=.coverage.{envname}

deps =
-cconstraints.txt
pytest-cov
pytest-remove-stale-bytecode
pytest-html

[testenv:py27-datetime]
basepython = python2.7
deps =
-cconstraints.txt
{[testenv]deps}
DateTime

[testenv:py36-datetime]
basepython = python3.6
deps =
-cconstraints.txt
{[testenv]deps}
DateTime

<<<<<<< HEAD
=======
[testenv:py27-rp3]
basepython = python2.7
commands =
coverage run {envbindir}/zope-testrunner --path=src/RestrictedPython --all {posargs}
deps =
-cconstraints.txt
.[test]
zope.testrunner
coverage

>>>>>>> Modification in tox.ini
[testenv:coverage]
basepython = python2.7
deps = coverage
skip_install = true

deps =
-cconstraints.txt
coverage

setenv =
COVERAGE_FILE=.coverage

skip_install = true
commands =
coverage erase
coverage combine
coverage html
coverage xml
coverage report

[testenv:isort]
basepython = python2.7
deps = isort
commands =
isort --check-only --recursive {toxinidir}/src {toxinidir}/tests {posargs}

[testenv:isort-apply]
basepython = python2.7
deps = isort
skip_install = true
deps =
-cconstraints.txt
isort

commands =
isort --apply --recursive {toxinidir}/src {toxinidir}/tests {posargs}

[testenv:flake8]
basepython = python2.7
[lint]
skip_install = true

deps =
-cconstraints.txt
flake8
# helper to generate HTML reports:
flake8-html
flake8-debugger
flake8-todo
# Useful flake8 plugins that are Python and Plone specific:
isort

commands =
- flake8 --format=html --htmldir={toxinidir}/reports/flake8 --doctests src tests setup.py {posargs}
flake8 --doctests src tests setup.py {posargs}
mkdir -p {toxinidir}/reports/flake8
isort --check-only --recursive {toxinidir}/src {toxinidir}/tests setup.py
- flake8 --format=html --htmldir={toxinidir}/reports/flake8 --doctests src tests setup.py
flake8 src tests setup.py --doctests

whitelist_externals =
mkdir

[testenv:lint-py2]
basepython = python2
skip_install = true
deps = {[lint]deps}
commands = {[lint]commands}
whitelist_externals = {[lint]whitelist_externals}

[testenv:lint-py3]
basepython = python3
skip_install = true
deps = {[lint]deps}
commands = {[lint]commands}
whitelist_externals = {[lint]whitelist_externals}

[testenv:docs]
basepython = python2.7
commands =
sphinx-build -b html -d build/docs/doctrees docs build/docs/html
sphinx-build -b doctest docs build/docs/doctrees
deps =
.[docs]
-cconstraints.txt
Sphinx

[testenv:release]
skip_install = true
basepython = python2.7

deps =
-cconstraints.txt
zest.releaser[recommended]

commands =
python -V
fullrelease --no-input -v

0 comments on commit 87937be

Please sign in to comment.