2014-09-21 14:37:29 +00:00
|
|
|
# Tox (http://tox.testrun.org/) is a tool for running tests
|
|
|
|
# in multiple virtualenvs. This configuration file will run the
|
|
|
|
# test suite on all supported python versions. To use it, "pip install tox"
|
|
|
|
# and then run "tox" from this directory.
|
|
|
|
|
|
|
|
[flake8]
|
|
|
|
max-line-length = 120
|
|
|
|
builtins = _,__request__
|
2014-09-25 21:58:00 +00:00
|
|
|
ignore = E133
|
2014-09-25 20:56:15 +00:00
|
|
|
exclude = .tox,.git,dist,build
|
2014-09-21 14:37:29 +00:00
|
|
|
|
|
|
|
[tox]
|
|
|
|
envlist = py27, py26, flake8, isort, docs
|
|
|
|
|
|
|
|
[testenv]
|
2014-09-25 20:56:15 +00:00
|
|
|
setenv = PYTHONPATH = {env:PYTHONPATH}:{env:PWD}
|
|
|
|
sitepackages = True
|
2014-09-21 14:37:29 +00:00
|
|
|
deps =
|
|
|
|
twisted
|
|
|
|
service_identity
|
|
|
|
mako
|
|
|
|
chardet
|
|
|
|
pyopenssl
|
|
|
|
pyxdg
|
|
|
|
pytest
|
2014-09-25 20:56:15 +00:00
|
|
|
whitelist_externals = py.test
|
|
|
|
commands = {envpython} setup.py test
|
2014-09-21 14:37:29 +00:00
|
|
|
|
|
|
|
[pytest]
|
2014-09-25 20:56:15 +00:00
|
|
|
python_functions = test_
|
|
|
|
norecursedirs = .tox .git dist build
|
2014-09-21 14:37:29 +00:00
|
|
|
pep8maxlinelength = 120
|
2014-09-25 20:56:15 +00:00
|
|
|
whitelist_externals= {[testenv]whitelist_externals}
|
|
|
|
commands = py.test deluge
|
2014-09-21 14:37:29 +00:00
|
|
|
|
|
|
|
[testenv:testcoverage]
|
2014-09-25 20:56:15 +00:00
|
|
|
install_command = pip install {opts} {packages}
|
2014-09-21 14:37:29 +00:00
|
|
|
deps =
|
|
|
|
{[testenv]deps}
|
|
|
|
pytest-cov
|
|
|
|
coverage
|
2014-09-25 20:56:15 +00:00
|
|
|
whitelist_externals =
|
2014-09-21 14:37:29 +00:00
|
|
|
{[testenv]whitelist_externals}
|
|
|
|
coverage
|
2014-09-25 20:56:15 +00:00
|
|
|
commands =
|
2014-09-21 14:37:29 +00:00
|
|
|
coverage run --branch --source=deluge -m py.test deluge/tests/
|
|
|
|
coverage report
|
|
|
|
# For creating html report
|
|
|
|
# coverage html -d docs/build/htmlcoverage
|
|
|
|
|
|
|
|
[testenv:pydef]
|
2014-09-25 20:56:15 +00:00
|
|
|
commands =
|
2014-09-21 14:37:29 +00:00
|
|
|
python -c "import libtorrent as lt; print lt.version"
|
|
|
|
py.test deluge/tests
|
|
|
|
|
2014-09-25 13:25:03 +00:00
|
|
|
[testenv:plugins]
|
2014-09-25 20:56:15 +00:00
|
|
|
commands = py.test deluge/plugins
|
2014-09-21 14:37:29 +00:00
|
|
|
|
|
|
|
[testenv:py26]
|
2014-09-25 20:56:15 +00:00
|
|
|
basepython = python2.6
|
|
|
|
commands = {[testenv:pydef]commands}
|
2014-09-21 14:37:29 +00:00
|
|
|
|
|
|
|
[testenv:py27]
|
2014-09-25 20:56:15 +00:00
|
|
|
basepython = python2.7
|
|
|
|
commands = {[testenv:pydef]commands}
|
2014-09-21 14:37:29 +00:00
|
|
|
|
|
|
|
[testenv:isort]
|
|
|
|
deps =
|
|
|
|
{[testenv]deps}
|
|
|
|
isort
|
2014-09-25 20:56:15 +00:00
|
|
|
whitelist_externals =
|
2014-09-21 14:37:29 +00:00
|
|
|
{[testenv]whitelist_externals}
|
|
|
|
isort
|
2014-09-25 20:56:15 +00:00
|
|
|
commands = isort --recursive --check-only deluge docs win32 *.py
|
2014-09-21 14:37:29 +00:00
|
|
|
|
|
|
|
[testenv:flake8]
|
2014-09-25 20:56:15 +00:00
|
|
|
setenv = {[testenv]setenv}
|
|
|
|
whitelist_externals =
|
2014-09-21 14:37:29 +00:00
|
|
|
{[testenv]whitelist_externals}
|
|
|
|
flake8
|
|
|
|
deps =
|
|
|
|
{[testenv]deps}
|
|
|
|
flake8
|
|
|
|
pep8-naming
|
2014-09-25 20:56:15 +00:00
|
|
|
commands = flake8
|
2014-09-21 14:37:29 +00:00
|
|
|
|
|
|
|
[testenv:flake8-complexity]
|
2014-09-25 20:56:15 +00:00
|
|
|
setenv = {[testenv]setenv}
|
|
|
|
whitelist_externals =
|
2014-09-21 14:37:29 +00:00
|
|
|
{[testenv]whitelist_externals}
|
|
|
|
flake8
|
|
|
|
sh
|
|
|
|
deps =
|
|
|
|
{[testenv:flake8]deps}
|
|
|
|
mccabe
|
2014-09-25 21:58:00 +00:00
|
|
|
commands = flake8 --exit-zero --max-complexity 15 deluge
|
2014-09-21 14:37:29 +00:00
|
|
|
|
2014-09-25 21:12:00 +00:00
|
|
|
# We do not have all dependencies on RTD and travis so we exclude the
|
|
|
|
# site packages (sitepackages=False) when building docs so that local
|
|
|
|
# tests have a similar environment.
|
2014-09-21 14:37:29 +00:00
|
|
|
|
2014-09-25 21:12:00 +00:00
|
|
|
[docsbase]
|
2014-09-25 20:56:15 +00:00
|
|
|
sitepackages = False
|
|
|
|
changedir = docs
|
|
|
|
install_command = pip install {opts} --allow-external PIL --allow-unverified PIL {packages}
|
|
|
|
whitelist_externals =
|
2014-09-21 14:37:29 +00:00
|
|
|
{[testenv]whitelist_externals}
|
|
|
|
sphinx-build
|
|
|
|
deps =
|
|
|
|
{[testenv]deps}
|
|
|
|
sphinx
|
|
|
|
sphinxcontrib-napoleon
|
|
|
|
PIL
|
2014-09-25 20:56:15 +00:00
|
|
|
commands = sphinx-build -E -W -b html -d build/doctrees source build/html
|
2014-09-25 21:12:00 +00:00
|
|
|
|
|
|
|
[testenv:docs]
|
2014-09-25 20:56:15 +00:00
|
|
|
sitepackages = {[docsbase]sitepackages}
|
|
|
|
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
|
2014-09-25 21:12:00 +00:00
|
|
|
|
|
|
|
[testenv:docscoverage]
|
2014-09-25 20:56:15 +00:00
|
|
|
sitepackages = {[docsbase]sitepackages}
|
|
|
|
changedir = {[docsbase]changedir}
|
|
|
|
install_command = {[docsbase]install_command}
|
|
|
|
whitelist_externals =
|
2014-09-25 21:12:00 +00:00
|
|
|
{[docsbase]whitelist_externals}
|
|
|
|
mkdir
|
2014-09-25 20:56:15 +00:00
|
|
|
deps =
|
2014-09-25 21:12:00 +00:00
|
|
|
{[docsbase]deps}
|
|
|
|
coverage
|
|
|
|
pytest-cov
|
2014-09-25 20:56:15 +00:00
|
|
|
commands =
|
2014-09-25 21:12:00 +00:00
|
|
|
mkdir -p build/doccoverage
|
|
|
|
sphinx-build -W -b coverage -d build/doctrees source build/doccoverage
|
|
|
|
py.test --doctest-glob='*.rst'
|