Refactor/cleanup of tox.ini

* Removed unused mock dep
 * Modified flake8 to run entire codebase (fixed exclude)
 * Change isort to shows files that need attention (no diff)
 * Uniform layout for tox.ini
 * Change flake8 complexity to 15
This commit is contained in:
Calum Lind 2014-09-25 21:56:15 +01:00
commit 23ab85e253
2 changed files with 43 additions and 60 deletions

View file

@ -1,7 +1,6 @@
twisted twisted
pyopenssl pyopenssl
sphinxcontrib-napoleon sphinxcontrib-napoleon
mock
pyxdg pyxdg
service_identity service_identity
PIL PIL

46
tox.ini
View file

@ -7,13 +7,12 @@
max-line-length = 120 max-line-length = 120
builtins = _,__request__ builtins = _,__request__
exclude = .tox,.git,dist,build exclude = .tox,.git,dist,build
ignore = E123,E133,E226,E241,E242
[tox] [tox]
envlist = py27, py26, flake8, isort, docs envlist = py27, py26, flake8, isort, docs
[testenv] [testenv]
commands = {envpython} setup.py test setenv = PYTHONPATH = {env:PYTHONPATH}:{env:PWD}
sitepackages = True sitepackages = True
deps = deps =
twisted twisted
@ -23,19 +22,15 @@ deps =
pyopenssl pyopenssl
pyxdg pyxdg
pytest pytest
whitelist_externals= whitelist_externals = py.test
py.test commands = {envpython} setup.py test
setenv =
PYTHONPATH = {env:PYTHONPATH}:{env:PWD}
[pytest] [pytest]
python_functions = test_ python_functions = test_
norecursedirs = .tox .git dist build norecursedirs = .tox .git dist build
pep8maxlinelength = 120 pep8maxlinelength = 120
whitelist_externals= whitelist_externals= {[testenv]whitelist_externals}
{[testenv]whitelist_externals} commands = py.test deluge
commands=
py.test deluge
[testenv:testcoverage] [testenv:testcoverage]
install_command = pip install {opts} {packages} install_command = pip install {opts} {packages}
@ -58,18 +53,15 @@ commands=
py.test deluge/tests py.test deluge/tests
[testenv:plugins] [testenv:plugins]
commands= commands = py.test deluge/plugins
py.test deluge/plugins
[testenv:py26] [testenv:py26]
basepython = python2.6 basepython = python2.6
commands= commands = {[testenv:pydef]commands}
{[testenv:pydef]commands}
[testenv:py27] [testenv:py27]
basepython = python2.7 basepython = python2.7
commands= commands = {[testenv:pydef]commands}
{[testenv:pydef]commands}
[testenv:isort] [testenv:isort]
deps = deps =
@ -78,12 +70,10 @@ deps =
whitelist_externals = whitelist_externals =
{[testenv]whitelist_externals} {[testenv]whitelist_externals}
isort isort
commands= commands = isort --recursive --check-only deluge docs win32 *.py
python -c "import subprocess, sys; output = subprocess.check_output('isort --recursive --diff --stdout deluge docs/ *.py', shell=True); print output; sys.exit(len(output) != 0)"
[testenv:flake8] [testenv:flake8]
setenv = setenv = {[testenv]setenv}
{[testenv]setenv}
whitelist_externals = whitelist_externals =
{[testenv]whitelist_externals} {[testenv]whitelist_externals}
flake8 flake8
@ -91,12 +81,10 @@ deps =
{[testenv]deps} {[testenv]deps}
flake8 flake8
pep8-naming pep8-naming
commands= commands = flake8
flake8 deluge
[testenv:flake8-complexity] [testenv:flake8-complexity]
setenv = setenv = {[testenv]setenv}
{[testenv]setenv}
whitelist_externals = whitelist_externals =
{[testenv]whitelist_externals} {[testenv]whitelist_externals}
flake8 flake8
@ -104,8 +92,7 @@ whitelist_externals=
deps = deps =
{[testenv:flake8]deps} {[testenv:flake8]deps}
mccabe mccabe
commands= commands = flake8 --max-complexity --exit-zero 15 deluge
sh -c "flake8 --max-complexity 10 deluge || true"
# We do not have all dependencies on RTD and travis so we exclude the # We do not have all dependencies on RTD and travis so we exclude the
# site packages (sitepackages=False) when building docs so that local # site packages (sitepackages=False) when building docs so that local
@ -122,10 +109,8 @@ deps =
{[testenv]deps} {[testenv]deps}
sphinx sphinx
sphinxcontrib-napoleon sphinxcontrib-napoleon
mock
PIL PIL
commands= commands = sphinx-build -E -W -b html -d build/doctrees source build/html
sphinx-build -E -W -b html -d build/doctrees source build/html
[testenv:docs] [testenv:docs]
sitepackages = {[docsbase]sitepackages} sitepackages = {[docsbase]sitepackages}
@ -133,8 +118,7 @@ changedir={[docsbase]changedir}
install_command = {[docsbase]install_command} install_command = {[docsbase]install_command}
whitelist_externals = {[docsbase]whitelist_externals} whitelist_externals = {[docsbase]whitelist_externals}
deps = {[docsbase]deps} deps = {[docsbase]deps}
commands= commands = sphinx-build -v -E -T -b html -d build/doctrees source build/html
sphinx-build -v -E -T -b html -d build/doctrees source build/html
[testenv:docscoverage] [testenv:docscoverage]
sitepackages = {[docsbase]sitepackages} sitepackages = {[docsbase]sitepackages}