py-twisted/tox.ini

145 lines
5.4 KiB
INI
Raw Normal View History

; tox configuration file for running tests similar to buildbot builders.
;
2016-08-21 13:21:24 +03:00
; The main trial based environments are defined based on a set of tags. Each
; tag will trigger a different behavior. Multiple tags can be set for the same environment:
;
2016-08-21 16:12:46 +03:00
; * alldeps - install all possible dependencies.
; * nodeps - avoid installing any dependency.
2016-08-21 13:21:24 +03:00
; * withcov - run the tests wrapped using the coverage.
; * nocov - run the tests directly, without using the coverage wrapper.
2016-08-21 16:12:46 +03:00
; * wheel - build the wheel distribution
2016-09-25 00:57:16 +03:00
; * posix - prepare the tests to be run in a Linux/Unix/macOS environment.
2017-11-17 09:22:56 +02:00
; * macos - prepare the tests to be run in a macOS 10.11+ environment (superset of posix)
; * macos1010 - prepare the tests to be run in a macOS 10.10 environment (superset of posix)
2016-08-21 13:21:24 +03:00
; * windows - prepare the tests to be executed under Windows.
;
2016-08-21 15:06:05 +03:00
; Some tags are defined only while transitioning to an updated Buildbot and
; should be removed after the transition.
; See: https://github.com/twisted-infra/braid/issues/222
;
; * tests - similar to alldeps
2016-08-21 15:11:21 +03:00
; * coverage - similar to withcov and alldeps
2016-08-21 15:06:05 +03:00
; * nomodules - similar to nodeps
;
2016-07-13 22:02:04 +03:00
; There is a non-default `codecov-publish` environment used to publish the
; coverage results to codecov.io. It should be called after running the
; standard coverage environment.
;
2016-07-31 16:07:08 +03:00
; A non-default `txchecker-travis` environment is used to run twistedchecker
; on travis in --diff mode
;
[tox]
minversion=2.4
skip_missing_interpreters=True
toxworkdir=build/
envlist=lint,pyflakes,apidocs,narrativedocs,newsfragment,manifest-checker,py27-alldeps-nocov,py36-alldeps-nocov
[testenv]
;; dependencies managed by extras in t.p._setup.py._EXTRAS_REQUIRE
extras =
{alldeps,tests,coverage}: all_non_platform
2016-08-21 15:06:05 +03:00
windows: windows_platform
2016-06-30 16:45:43 +03:00
{alldeps,tests}-macos: osx_platform
2018-03-20 19:29:34 +02:00
; Documentation needs Twisted install to get the version.
narrativedocs: dev
2016-09-25 03:04:22 +03:00
;; dependencies that are not specified as extras
deps =
py27-{alldeps,tests,coverage}-{posix,macos}: pysqlite
2016-09-25 03:04:22 +03:00
2016-08-21 15:24:20 +03:00
{withcov,coverage}: coverage
2016-06-30 16:45:43 +03:00
codecov-publish: codecov==2.0.5
2016-08-21 13:21:24 +03:00
2016-08-21 16:12:46 +03:00
wheel: wheel
2016-06-30 16:45:43 +03:00
; Code quality checkers
2016-08-21 13:21:24 +03:00
manifest-checker: check-manifest
lint: pyflakes
lint: twistedchecker>=0.7.1
lint: diff-cover==0.9.12
lint: pycodestyle
2016-06-30 16:45:43 +03:00
2018-09-24 00:23:44 +03:00
wheels: cibuildwheel==0.10.0
2016-08-21 13:21:24 +03:00
; All environment variables are passed.
passenv = *
setenv =
2016-08-21 16:12:46 +03:00
; Enable sub-processes coverage reports and store coverage reports in a
; known location.
COVERAGE_PROCESS_START = {toxinidir}/.coveragerc
2016-08-21 13:21:24 +03:00
COVERAGE_FILE = {toxinidir}/.coverage
2016-08-21 13:53:37 +03:00
# Help tests know where the base directory is.
TOX_INI_DIR = {toxinidir}
2016-12-15 03:50:47 +02:00
; Skip twistedchecker warnings that are not yet required in the required run
lint: TWISTEDCHECKER_SKIP_WARNINGS = W9208,C0302,C0103,C9302
wheels: CIBW_BUILD=cp27-* cp34-* cp35-* cp36-* cp37-*
commands =
2016-08-21 16:12:46 +03:00
;
; Display information about Python interpreter
; which will be used in subsequent steps
;
python -c "import sys; print(sys.prefix)"
python -c "import sys; print(sys.exec_prefix)"
python -c "import sys; print(sys.executable)"
python -c "import sys; print(sys.version)"
python -c "import sys; print(sys.platform)"
python --version
2018-07-24 11:01:05 +03:00
# We need to define nodeps *somewhere* so tox recognises it
nodeps: python -c "print('No dependencies installed...')"
; Install PyDoctor here so it DOESNT overwrite Twisted
2016-07-23 17:19:21 +03:00
apidocs: pip install --no-deps epydoc pydoctor
2016-08-21 16:12:46 +03:00
; Run tests without wrapping them using coverage.
2016-08-21 15:07:01 +03:00
{nocov,nomodules,tests}: python -m twisted.trial --reactor={env:TWISTED_REACTOR:default} --reporter={env:TRIAL_REPORTER:verbose} {posargs:twisted}
2016-08-21 16:12:46 +03:00
; Run the tests wrapped using coverage.
2016-08-21 15:06:05 +03:00
{withcov,coverage}: python {toxinidir}/admin/_copy.py {toxinidir}/admin/zz_coverage.pth {envsitepackagesdir}/zz_coverage.pth
{withcov,coverage}: coverage erase
{withcov,coverage}: coverage run -p --rcfile={toxinidir}/.coveragerc -m twisted.trial --reactor={env:TWISTED_REACTOR:default} --reporter={env:TRIAL_REPORTER:verbose} {posargs:twisted}
2016-08-21 16:12:46 +03:00
; Publish the coverage reports to codecov.io
2016-08-05 03:30:30 +03:00
codecov-publish: coverage combine
2016-07-13 22:02:04 +03:00
codecov-publish: coverage xml -o coverage.xml -i
2017-08-04 10:26:55 +03:00
codecov-publish: codecov {env:CODECOV_OPTIONS:} -X search -X gcov -f coverage.xml
2016-08-21 16:12:46 +03:00
; Build in a root folder so that buildbot can pick the result
wheel: python setup.py bdist_wheel --dist-dir {toxinidir}/dist
lint: /bin/sh -c "pyflakes $(find src/twisted admin bin \! -name "compat.py" \! -name "test_compat.py" \! -name "dict.py" -name '*.py' -o -name '*.3only')"
lint: {toxinidir}/.travis/twistedchecker-trunk-diff.sh {posargs:twisted}
lint: /bin/sh -c "git diff trunk | python {toxinidir}/admin/pycodestyle-twisted.py --diff"
2016-06-28 19:39:34 +03:00
2016-07-23 17:12:41 +03:00
apidocs: {toxinidir}/bin/admin/build-apidocs {toxinidir}/src/ apidocs
narrativedocs: sphinx-build -aW -b html -d {toxinidir}/docs/_build {toxinidir}/docs {toxinidir}/docs/_build/
2017-08-04 07:29:33 +03:00
newsfragment: python {toxinidir}/bin/admin/check-newsfragment "{toxinidir}"
2016-05-18 08:15:27 +03:00
2016-07-20 10:07:11 +03:00
manifest-checker: check-manifest --ignore "docs/_build*,docs/historic/*,admin*,bin/admin*,twisted/topfiles/*.Old"
2016-07-20 09:41:19 +03:00
wheels: cibuildwheel --output-dir {toxinidir}/wheelhouse {toxinidir}
wheels: python setup.py sdist --formats=gztar,zip --dist-dir={toxinidir}/wheelhouse
2018-09-19 05:21:31 +03:00
wheels: ls -l {toxinidir}/wheelhouse
[testenv:apidocs]
# Epydoc and pydoctor currently on work on Python 2
basepython=python2.7
2018-03-20 19:29:34 +02:00
2016-07-20 09:41:19 +03:00
[testenv:manifest-checker]
2018-03-20 16:41:19 +02:00
skip_install = true
2017-08-19 16:14:35 +03:00
# TwistedChecker needs to be 3.5
[testenv:lint]
2017-08-19 16:14:35 +03:00
basepython=python3.5
2016-11-18 05:22:41 +02:00
usedevelop=True