deluge/tox.ini

190 lines
4.3 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, py3, lint, docs
minversion=3.0
[pytest]
# Hide logged warnings and errors in test output.
log_cli_level = CRITICAL
addopts = -p no:warnings --basetemp=_pytest_temp
# =================
# Base dependencies
# =================
[basesetup]
# Minimum pip and setuptools versions to fix system and travis issues.
2018-10-08 15:05:40 +00:00
deps =
pip>=10
setuptools>=40
[basetests]
deps =
{[basesetup]deps}
-rrequirements.txt
-rrequirements-tests.txt
[baselint]
deps =
{[basesetup]deps}
-rrequirements-tests.txt
[basedev]
deps =
{[basesetup]deps}
2018-10-08 15:05:40 +00:00
-rrequirements.txt
-rrequirements-dev.txt
-rrequirements-tests.txt
[basedocs]
deps =
{[basesetup]deps}
-rrequirements-docs.txt
# ======================
# Test environment setup
# ======================
[testenv]
install_command = python -m pip install --ignore-installed {opts} {packages}
passenv = DISPLAY PYTHONPATH
setenv =
PYTHONPATH = {toxinidir}
PYTEST_ADDOPTS = -v -s
sitepackages = True
deps = {[basetests]deps}
commands =
python -c "import libtorrent as lt; print(lt.__version__)"
pytest -m "not (todo or gtkui or security)" deluge/tests
# ==========
# Unit tests
# ==========
[testenv:security]
setenv = SECURITY_TESTS = True
commands = pytest -m "security" deluge/tests
[testenv:gtkui]
commands = pytest -m "gtkui" deluge/tests
[testenv:todo]
commands = pytest -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
commands =
python setup.py build_plugins --develop --install-dir={toxinidir}/deluge/plugins/
pytest -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 deluge/plugins
# ============
# Code linting
# ============
# Disable site-packages to avoid using system installed commands.
[testenv:lint]
sitepackages = False
passenv = HOMEPATH SSH_AUTH_SOCK
deps = {[baselint]deps}
commands = pre-commit run --all-files
[testenv:flake8]
2016-05-21 17:53:40 +00:00
sitepackages = False
deps = {[baselint]deps}
commands =
flake8 --version
python -c 'import isort; print(isort.__version__)'
flake8 *.py deluge
[testenv:flake8-complexity]
2016-05-21 17:53:40 +00:00
sitepackages = False
deps = {[baselint]deps}
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
sitepackages = False
2016-11-02 08:12:55 +00:00
ignore_errors = True
deps = {[baselint]deps}
2016-04-19 17:06:55 +00:00
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
# ========
# Coverage
# ========
2016-04-19 17:06:55 +00:00
[coveragebase]
commands = coverage run --branch --source=deluge -m pytest -m "not todo" deluge/tests
[testenv:coverage]
commands =
{[coveragebase]commands}
coverage html -d docs/build/htmlcoverage
coverage report
# ===================
# Documentation build
# ===================
2014-09-25 21:12:00 +00:00
[testenv:docs]
basepython = python2.7
# Exclude site-packages so local builds have a similar environment to ReadTheDocs.
sitepackages = False
skip_install = True
deps = {[basedocs]deps}
2016-05-21 17:53:40 +00:00
commands =
2016-11-27 17:04:12 +00:00
python setup.py clean_docs
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]
basepython = python2.7
sitepackages = False
skip_install = True
changedir = docs
deps =
{[basedocs]deps}
2014-09-25 21:12:00 +00:00
pytest-cov
whitelist_externals = 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'
# ========================
# Development Environment
# ========================
2018-10-08 15:05:40 +00:00
[testenv:denv2]
basepython = python2.7
envdir = .venv2
usedevelop = True
2018-10-08 15:05:40 +00:00
deps = {[basedev]deps}
commands =
2018-10-08 15:05:40 +00:00
[testenv:denv3]
basepython = python3
envdir = .venv3
usedevelop = True
2018-10-08 15:05:40 +00:00
deps = {[basedev]deps}
commands =