py-twisted/tox.ini

167 lines
5.8 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.
;
2019-04-13 08:17:10 +03:00
; There is are non-default `codecov-push` and `coveralls-push` environments
; used to push the coverage results to codecov.io and coveralls.io,
; respectively. They should be called after running both some number of
; `-withcov` environments and also `coverage-prepare`.
; For compatibility with the current buildbot infrastructure, `codecov-publish`
; combines `coverage-prepare` and `codecov-push` into a single step.
;
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,twine,py27-alldeps-nocov,py36-alldeps-nocov
[testenv]
;; dependencies managed by extras in t.p._setup.py._EXTRAS_REQUIRE
extras =
2019-04-13 08:17:10 +03:00
alldeps: all_non_platform
2016-08-21 15:06:05 +03:00
windows: windows_platform
2016-06-30 16:45:43 +03:00
2019-04-13 08:17:10 +03:00
alldeps-macos: osx_platform
serial: serial
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 =
2019-04-13 08:17:10 +03:00
py27-alldeps-{posix,macos}: pysqlite
2016-09-25 03:04:22 +03:00
{withcov}: coverage
{coverage-prepare,codecov-publish}: coverage
2019-04-13 08:25:43 +03:00
{codecov-push,codecov-publish}: codecov
2019-04-13 08:25:43 +03:00
coveralls-push: coveralls
2019-04-15 00:28:07 +03:00
coveralls-push: PyYAML
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
twine: twine
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 =
2019-01-14 00:55:18 +02:00
; Enable sub-processes coverage reports and store coverage reports in a
; known location.
COVERAGE_PROCESS_START = {toxinidir}/.coveragerc
COVERAGE_FILE = {toxinidir}/.coverage
# Help tests know where the base directory is.
TOX_INI_DIR = {toxinidir}
2019-01-14 00:55:18 +02:00
; Skip twistedchecker warnings that are not yet required in the required run
lint: TWISTEDCHECKER_SKIP_WARNINGS = W9208,C0302,C0103,C9302
2019-01-14 00:55:18 +02:00
; Configure cibuildwheel to build wheels for:
2019-04-06 08:08:57 +03:00
; CPython 2.7, 3.5, 3.6, and 3.7.
2019-01-14 00:55:18 +02:00
; This includes variants of bit depth, unicode width, etc.
2019-04-06 08:08:57 +03:00
wheels: CIBW_BUILD=cp27-* cp35-* cp36-* cp37-*
; If serial or windows extras, force serial testing
{windows,serial}: TWISTED_FORCE_SERIAL_TESTS = 1
commands =
2016-08-21 16:12:46 +03:00
;
; Display information about Python interpreter
; which will be used in subsequent steps
;
2019-01-14 00:55:18 +02:00
python {toxinidir}/admin/dump_all_version_info.py
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...')"
2016-08-21 16:12:46 +03:00
; Run tests without wrapping them using coverage.
2019-04-13 08:17:10 +03:00
nocov: 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.
2019-04-13 08:17:10 +03:00
withcov: python {toxinidir}/admin/_copy.py {toxinidir}/admin/zz_coverage.pth {envsitepackagesdir}/zz_coverage.pth
withcov: coverage erase
withcov: coverage run -p --rcfile={toxinidir}/.coveragerc -m twisted.trial --reactor={env:TWISTED_REACTOR:default} --reporter={env:TRIAL_REPORTER:verbose} {posargs:twisted}
; Prepare coverage reports for publication.
2019-04-13 08:17:10 +03:00
{coverage-prepare,codecov-publish}: coverage combine
{coverage-prepare,codecov-publish}: coverage xml -o coverage.xml -i
; Publish coverage reports to codecov.
2019-04-13 08:17:10 +03:00
{codecov-push,codecov-publish}: codecov {env:CODECOV_OPTIONS:} -X search -X gcov -f coverage.xml
; Publish coverage reports to coveralls.
2019-04-13 08:17:10 +03:00
coveralls-push: coveralls
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 $(git merge-base trunk HEAD) | 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
twine: twine check {distdir}/*.*
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
2019-11-24 08:06:23 +02:00
deps=pydoctor
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
[testenv:coverage-prepare]
skip_install=True
[testenv:codecov-publish]
skip_install=True
[testenv:codecov-push]
skip_install=True
[testenv:coveralls-push]
skip_install=True