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
parent bb9702910b
commit 23ab85e253
2 changed files with 43 additions and 60 deletions

View File

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

46
tox.ini
View File

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