deluge/tox.ini

201 lines
4.9 KiB
INI
Raw Normal View History

2016-04-07 18:11:32 +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.
#
# Usage: `pip install tox` and then run `tox` from this directory.
[tox]
envlist = py27, lint, docs
2018-05-20 23:21:20 +00:00
minversion=2.0
[base]
deps = -rrequirements.txt
[testenv]
install_command = pip install --ignore-installed {opts} {packages}
passenv = DISPLAY PYTHONPATH
2018-05-20 23:21:20 +00:00
setenv = PYTHONPATH = {toxinidir}
sitepackages = True
deps =
{[base]deps}
-rrequirements-tests.txt
whitelist_externals = pytest
[pytest]
# Hide logged warnings and errors in test output.
log_cli_level = CRITICAL
# ==========
# Unit tests
# ==========
[testenv:pydef]
commands =
2017-03-03 10:14:34 +00:00
python -c "import libtorrent as lt; print(lt.__version__)"
pytest -v --basetemp=_pytest_temp -s -m "not (todo or gtkui or security)" deluge/tests
[testenv:security]
setenv = SECURITY_TESTS = True
commands = pytest -v --basetemp=_pytest_temp -s -m "security" deluge/tests/
[testenv:pygtkui]
commands = pytest -v --basetemp=_pytest_temp -s -m "gtkui" deluge/tests
[testenv:todo]
commands = pytest -v --basetemp=_pytest_temp -s -m "todo" deluge/tests
[testenv:trial]
2018-05-20 23:21:20 +00:00
setenv = {[testenv]setenv}{:}{toxinidir}/deluge/tests
commands =
python -c "import libtorrent as lt; print lt.__version__"
python -m twisted.trial --reporter=deluge-reporter deluge.tests
2014-09-25 13:25:03 +00:00
[testenv:plugins]
2018-05-20 23:21:20 +00:00
setenv = PYTHONPATH = {toxinidir}{:}{toxinidir}/deluge/plugins
whitelist_externals = bash
commands =
python setup.py build_plugins --develop --install-dir={toxinidir}/deluge/plugins/
pytest -v --basetemp=_pytest_temp -s -m "not gtkui" deluge/plugins
[testenv:pluginsgtkui]
2018-05-20 23:21:20 +00:00
setenv = PYTHONPATH = {toxinidir}{:}{toxinidir}/deluge/plugins
commands =
python setup.py build_plugins --develop --install-dir={toxinidir}/deluge/plugins/
pytest -v --basetemp=_pytest_temp -s deluge/plugins
[testenv:py27]
2017-03-03 10:14:34 +00:00
deps =
{[testenv]deps}
basepython = python2.7
commands = {[testenv:pydef]commands}
2017-03-03 10:14:34 +00:00
[testenv:py3]
basepython = python3
commands = {[testenv:pydef]commands}
# =======================
# Code linting
# =======================
[testenv:lint]
passenv = HOMEPATH SSH_AUTH_SOCK
deps =
pre-commit
commands =
pre-commit run --all-files
[testenv:flake8]
# Disable site packages to avoid using system flake8 which uses
# hardcoded python path which imports the wrong libraries.
2016-05-21 17:53:40 +00:00
sitepackages = False
deps =
{[testenv]deps}
flake8
flake8-quotes
flake8-isort
pep8-naming
commands =
flake8 --version
python -c 'import isort; print(isort.__version__)'
flake8
[testenv:flake8-complexity]
2016-05-21 17:53:40 +00:00
sitepackages = False
deps =
{[testenv:flake8]deps}
mccabe
2014-09-25 21:58:00 +00:00
commands = flake8 --exit-zero --max-complexity 15 deluge
2016-04-19 17:06:55 +00:00
[testenv:pylint]
2016-05-21 17:53:40 +00:00
# Disable site packages to avoid using system installed version
sitepackages = False
2016-11-02 08:12:55 +00:00
ignore_errors = True
2016-04-19 17:06:55 +00:00
deps =
{[testenv]deps}
pylint
commands =
pylint --version
pylint deluge
# Use python to enable use of wildcard paths with pylint.
python -m pylint *.py deluge/scripts/*.py
python -m pylint deluge/plugins/*/deluge/
2016-04-19 17:06:55 +00:00
# =============
# Test coverage
# =============
[testcoveragebase]
deps =
{[testenv]deps}
pytest-cov
coverage
whitelist_externals =
{[testenv]whitelist_externals}
coverage
commands = coverage run --branch --source=deluge -m pytest -m "not todo" deluge/tests/
[testenv:testcoverage]
setenv = {[testenv]setenv}
2016-04-07 18:11:32 +00:00
deps = {[testcoveragebase]deps}
whitelist_externals = {[testcoveragebase]whitelist_externals}
commands =
{[testcoveragebase]commands}
coverage report
[testenv:testcoverage-html]
setenv = {[testenv]setenv}
2016-04-07 18:11:32 +00:00
deps = {[testcoveragebase]deps}
whitelist_externals = {[testcoveragebase]whitelist_externals}
commands =
{[testcoveragebase]commands}
coverage html -d docs/build/htmlcoverage
# ===================
# Documentation build
# ===================
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-25 21:12:00 +00:00
[docsbase]
sitepackages = False
changedir = docs
deps =
-rrequirements-docs.txt
2014-09-25 21:12:00 +00:00
[testenv:docs]
sitepackages = {[docsbase]sitepackages}
deps = {[docsbase]deps}
2016-05-21 17:53:40 +00:00
commands =
2016-11-27 17:04:12 +00:00
python setup.py clean_docs
sphinx-apidoc --force -o docs/source/modules/ deluge deluge/plugins
sphinx-build -v -j auto -E -T -b html -d docs/build/doctrees docs/source docs/build/html
2014-09-25 21:12:00 +00:00
[testenv:docscoverage]
sitepackages = {[docsbase]sitepackages}
changedir = {[docsbase]changedir}
deps =
2014-09-25 21:12:00 +00:00
{[docsbase]deps}
pytest-cov
2016-04-07 18:11:32 +00:00
whitelist_externals =
pytest
2016-04-07 18:11:32 +00:00
mkdir
commands =
2014-09-25 21:12:00 +00:00
mkdir -p build/doccoverage
sphinx-build -W -b coverage -d build/doctrees source build/doccoverage
pytest --doctest-glob='*.rst'
# ========================
# Developement Environment
# ========================
[testenv:devenv]
envdir = .venv
usedevelop = True
deps = -rrequirements-dev.txt