-
Notifications
You must be signed in to change notification settings - Fork 7
/
tox.ini
157 lines (138 loc) · 5.64 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# 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.
[pytest]
twisted = 1
[tox]
envlist = codechecks{,-junit},{py3,pypy3}-{coverage,nocoverage},integration{,-1_17,-1_18,-master}{,-junit}
minversion = 2.4
[testenv]
setenv =
# see https://github.com/pypa/pip/issues/6264 which seems to
# happen, at least on Debian 10
SETUPTOOLS_USE_DISTUTILS=stdlib
passenv = MAGIC_FOLDER_*,PIP_*,SUBUNITREPORTER_*,USERPROFILE,HOMEDRIVE,HOMEPATH
deps =
-r requirements/tox.txt
whitelist_externals =
/usr/bin/git
isolated_build = True
# We add usedevelop=False because testing against a true installation gives
# more useful results.
usedevelop = False
# We use extras=test to get things like "mock" that are required for our unit
# tests.
extras = test
commands =
# As an aid to debugging, dump all of the Python packages and their
# versions that are installed in the test environment. This is
# particularly useful to get from CI runs - though hopefully the
# version pinning we do limits the variability of this output
# somewhat.
pip freeze
python misc/build_helpers/sqlite_version.py
magic-folder --version
nocoverage: python -m twisted.trial {env:MAGIC_FOLDER_TRIAL_ARGS:--rterrors} {posargs:magic_folder}
coverage: coverage run --branch -m twisted.trial {env:MAGIC_FOLDER_TRIAL_ARGS:--rterrors} {posargs:magic_folder}
coverage: coverage combine
coverage: coverage xml
[testenv:integration{,-1_17,-1_18,-master}{,-junit}]
setenv =
COVERAGE_PROCESS_START=.coveragerc
MAGIC_FOLDER_TAHOE_TOX_ENV=tahoe1_17
1_17: MAGIC_FOLDER_TAHOE_TOX_ENV=tahoe1_17
1_18: MAGIC_FOLDER_TAHOE_TOX_ENV=tahoe1_18
master: MAGIC_FOLDER_TAHOE_TOX_ENV=tahoemaster
# We need to unset --no-index here, since we need to talke to github to install from master
master: PIP_NO_INDEX=
whitelist_externals =
junit: /bin/mkdir
commands =
# NOTE: 'run with "py.test --keep-tempdir -s -v integration/" to debug failures'
!junit: py.test --coverage -sv integration/ --tahoe-tox-env {env:MAGIC_FOLDER_TAHOE_TOX_ENV} {posargs:}
junit: mkdir -p junit
junit: py.test --junitxml=junit/pytest.xml --coverage -sv integration/ --tahoe-tox-env {env:MAGIC_FOLDER_TAHOE_TOX_ENV} {posargs:}
coverage combine
coverage xml
coverage report
# These environments are used to install the appropriate versions of
# tahoe for the above integration tests.
[testenv:tahoe{1_17,1_18,master}]
skip_install = True
deps =
tahoe1_17: -r requirements/tahoe-integration-1.17.txt
tahoe1_18: -r requirements/tahoe-integration-1.18.txt
tahoemaster: -r requirements/tahoe-integration-master.txt
commands =
pip freeze
# aka "lint" CI job
[testenv:codechecks{,-junit}]
deps =
towncrier==21.3.0
junit: flake8-formatter-junit-xml
whitelist_externals =
/bin/mv
junit: /bin/mkdir
commands =
!junit: flake8 src misc setup.py integration
junit: mkdir junit
junit: flake8 --format=junit-xml --output-file junit/flake8.xml src misc setup.py integration
python misc/coding_tools/check-debugging.py
# If towncrier.check fails, you forgot to add a towncrier news
# fragment explaining the change in this branch. Create one at
# `newsfragments/<ticket>.<change type>` with some text for the news
# file. See pyproject.toml for legal <change type> values.
python -m towncrier.check --compare-with origin/main
[testenv:draftnews]
passenv = MAGIC_FOLDER_*,PIP_*,SUBUNITREPORTER_*,USERPROFILE,HOMEDRIVE,HOMEPATH
deps =
towncrier >= 21.3.0
commands =
# towncrier 21.3.0
python -m towncrier --draft
[testenv:deprecations]
commands =
python misc/build_helpers/run-deprecations.py --package magic_folder --warnings={env:MAGIC_FOLDER_WARNINGS_LOG:_trial_temp/deprecation-warnings.log} python -m twisted.trial {env:MAGIC_FOLDER_TRIAL_ARGS:--rterrors} {posargs:magic_folder}
# Use 'tox -e docs' to check formatting and cross-references in docs .rst
# files. The published docs are built by code run over at readthedocs.org,
# which does not use this target (but does something similar).
#
# If you have "sphinx" installed in your virtualenv, you can just do "make -C
# docs html", or "cd docs; make html".
#
# You can also open docs/_build/html/index.html to see the rendered docs in
# your web browser.
[testenv:docs]
# we pin docutils because of https://sourceforge.net/p/docutils/bugs/301/
# which asserts when it reads links to .svg files (e.g. about.rst)
deps =
sphinx
docutils==0.19
# normal install is not needed for docs, and slows things down
skip_install = True
commands =
sphinx-build -b html -d {toxinidir}/docs/_build/doctrees {toxinidir}/docs {toxinidir}/docs/_build/html
[testenv:tarballs]
deps =
commands =
python setup.py sdist --formats=bztar,gztar,zip bdist_wheel
# IMPORTANT: run this with the _lowest_ Python version we support (in
# at least one upgrade, python 3.8 needed "importlib-resources" but
# later Pythons did not)
[testenv:pin-requirements]
basepython = python3
deps =
pip-compile-multi
twisted
skip_install = True
commands =
python misc/build_helpers/platform-pins.py \
--remove \
requirements/base.txt \
requirements/platform.txt
# --allow-unsafe is a future default
pip-compile-multi --allow-unsafe -g base -g tox -g test {posargs}
python misc/build_helpers/platform-pins.py \
requirements/base.txt \
requirements/platform.txt