source: trunk/tox.ini @ 9853fa9

Last change on this file since 9853fa9 was 9853fa9, checked in by Jean-Paul Calderone <exarkun@…>, at 2020-08-10T13:59:36Z

Pin Python 2 compatible PyInstaller?

  • Property mode set to 100644
File size: 8.9 KB
Line 
1# Tox (http://tox.testrun.org/) is a tool for running tests
2# in multiple virtualenvs. This configuration file will run the
3# test suite on all supported python versions. To use it, "pip install tox"
4# and then run "tox" from this directory.
5
6[pytest]
7twisted = 1
8
9[tox]
10envlist = {py27,pypy27,py36}{-coverage,}
11minversion = 2.4
12
13[testenv]
14passenv = TAHOE_LAFS_* PIP_* SUBUNITREPORTER_* USERPROFILE HOMEDRIVE HOMEPATH
15# Get "certifi" to avoid bug #2913. Basically if a `setup_requires=...` causes
16# a package to be installed (with setuptools) then it'll fail on certain
17# platforms (travis's OX-X 10.12, Slackware 14.2) because PyPI's TLS
18# requirements (TLS >= 1.2) are incompatible with the old TLS clients
19# available to those systems.  Installing it ahead of time (with pip) avoids
20# this problem.
21deps =
22     # Pin all of these versions for the same reason you ever want to pin
23     # anything: to prevent new releases with regressions from introducing
24     # spurious failures into CI runs for whatever development work is
25     # happening at the time.  The versions selected here are just the current
26     # versions at the time.  Bumping them to keep up with future releases is
27     # fine as long as those releases are known to actually work.
28     pip==19.1.1
29     setuptools==41.0.1
30     wheel==0.33.4
31     subunitreporter==19.3.2
32     # As an exception, we don't pin certifi because it contains CA
33     # certificates which necessarily change over time.  Pinning this is
34     # guaranteed to cause things to break eventually as old certificates
35     # expire and as new ones are used in the wild that aren't present in
36     # whatever version we pin.  Hopefully there won't be functionality
37     # regressions in new releases of this package that cause us the kind of
38     # suffering we're trying to avoid with the above pins.
39     certifi
40
41# We add usedevelop=False because testing against a true installation gives
42# more useful results.
43usedevelop = False
44# We use extras=test to get things like "mock" that are required for our unit
45# tests.
46extras = test
47commands =
48         trial {env:TAHOE_LAFS_TRIAL_ARGS:--rterrors} {posargs:allmydata}
49         tahoe --version
50
51[testenv:py36]
52# On macOS, git inside of ratchet.sh needs $HOME.
53passenv = HOME
54commands = {toxinidir}/misc/python3/ratchet.sh
55
56[testenv:integration]
57setenv =
58         COVERAGE_PROCESS_START=.coveragerc
59commands =
60         # NOTE: 'run with "py.test --keep-tempdir -s -v integration/" to debug failures'
61         py.test --coverage -v {posargs:integration}
62         coverage combine
63         coverage report
64
65[testenv:coverage]
66# coverage (with --branch) takes about 65% longer to run
67commands =
68         # As an aid to debugging, dump all of the Python packages and their
69         # versions that are installed in the test environment.  This is
70         # particularly useful to get from CI runs - though hopefully the
71         # version pinning we do limits the variability of this output
72         # somewhat.
73         pip freeze
74         tahoe --version
75         coverage run --branch -m twisted.trial {env:TAHOE_LAFS_TRIAL_ARGS:--rterrors --reporter=timing} {posargs:allmydata}
76         coverage combine
77         coverage xml
78
79[testenv:codechecks]
80# On macOS, git inside of towncrier needs $HOME.
81passenv = HOME
82whitelist_externals =
83         /bin/mv
84commands =
85         flake8 src static misc setup.py
86         python misc/coding_tools/check-umids.py src
87         python misc/coding_tools/check-debugging.py
88         python misc/coding_tools/find-trailing-spaces.py -r src static misc setup.py
89         python misc/coding_tools/check-miscaptures.py
90
91         # If towncrier.check fails, you forgot to add a towncrier news
92         # fragment explaining the change in this branch.  Create one at
93         # `newsfragments/<ticket>.<change type>` with some text for the news
94         # file.  See pyproject.toml for legal <change type> values.
95         python -m towncrier.check --pyproject towncrier.pyproject.toml
96
97[testenv:draftnews]
98passenv = TAHOE_LAFS_* PIP_* SUBUNITREPORTER_* USERPROFILE HOMEDRIVE HOMEPATH
99# see comment in [testenv] about "certifi"
100whitelist_externals = mv
101deps =
102     certifi
103     towncrier >= 19.2
104commands =
105         # With pip >= 10 the existence of pyproject.toml (which we are
106         # required to have to configure towncrier) triggers a "build
107         # isolation" mode which prevents anything from working.  Avoid
108         # triggering that pip behavior by keeping the towncrier configuration
109         # somewhere else and only bringing it in when it's actually needed
110         # (after pip is done).
111         #
112         # Some discussion is available at
113         # https://github.com/pypa/pip/issues/5696
114         #
115         # towncrier post 19.2 (unreleased as of this writing) adds a --config
116         # option that can be used instead of this file shuffling.
117         mv towncrier.pyproject.toml pyproject.toml
118
119         # towncrier 19.2 + works with python2.7
120         python -m towncrier --draft
121
122         # put it back
123         mv pyproject.toml towncrier.pyproject.toml
124
125[testenv:news]
126passenv = TAHOE_LAFS_* PIP_* SUBUNITREPORTER_* USERPROFILE HOMEDRIVE HOMEPATH
127# see comment in [testenv] about "certifi"
128whitelist_externals = mv
129deps =
130     certifi
131     towncrier >= 19.2
132commands =
133         # With pip >= 10 the existence of pyproject.toml (which we are
134         # required to have to configure towncrier) triggers a "build
135         # isolation" mode which prevents anything from working.  Avoid
136         # triggering that pip behavior by keeping the towncrier configuration
137         # somewhere else and only bringing it in when it's actually needed
138         # (after pip is done).
139         #
140         # Some discussion is available at
141         # https://github.com/pypa/pip/issues/5696
142         #
143         # towncrier post 19.2 (unreleased as of this writing) adds a --config
144         # option that can be used instead of this file shuffling.
145         mv towncrier.pyproject.toml pyproject.toml
146
147         # towncrier 19.2 + works with python2.7
148         python -m towncrier --yes
149
150         # put it back
151         mv pyproject.toml towncrier.pyproject.toml
152
153         # commit the changes
154         git commit -m "update NEWS.txt for release"
155
156[testenv:deprecations]
157setenv =
158         PYTHONWARNINGS=default::DeprecationWarning
159commands =
160         python misc/build_helpers/run-deprecations.py --package allmydata --warnings={env:TAHOE_LAFS_WARNINGS_LOG:_trial_temp/deprecation-warnings.log} trial {env:TAHOE_LAFS_TRIAL_ARGS:--rterrors} {posargs:allmydata}
161
162[testenv:upcoming-deprecations]
163setenv =
164         PYTHONWARNINGS=default::DeprecationWarning
165deps =
166     # Take the base deps as well!
167     {[testenv]deps}
168     git+https://github.com/warner/foolscap
169commands =
170         flogtool --version
171         python misc/build_helpers/run-deprecations.py --package allmydata --warnings={env:TAHOE_LAFS_WARNINGS_LOG:_trial_temp/deprecation-warnings.log} trial {env:TAHOE_LAFS_TRIAL_ARGS:--rterrors} {posargs:allmydata}
172
173[testenv:checkmemory]
174commands =
175         rm -rf _test_memory
176         python src/allmydata/test/check_memory.py upload
177         python src/allmydata/test/check_memory.py upload-self
178         python src/allmydata/test/check_memory.py upload-POST
179         python src/allmydata/test/check_memory.py download
180         python src/allmydata/test/check_memory.py download-GET
181         python src/allmydata/test/check_memory.py download-GET-slow
182         python src/allmydata/test/check_memory.py receive
183
184# Use 'tox -e docs' to check formatting and cross-references in docs .rst
185# files. The published docs are built by code run over at readthedocs.org,
186# which does not use this target (but does something similar).
187#
188# If you have "sphinx" installed in your virtualenv, you can just do "make -C
189# docs html", or "cd docs; make html".
190#
191# You can also open docs/_build/html/index.html to see the rendered docs in
192# your web browser.
193
194[testenv:docs]
195# we pin docutils because of https://sourceforge.net/p/docutils/bugs/301/
196# which asserts when it reads links to .svg files (e.g. about.rst)
197deps =
198     sphinx
199     docutils==0.12
200# normal install is not needed for docs, and slows things down
201skip_install = True
202commands =
203         sphinx-build -b html -d {toxinidir}/docs/_build/doctrees {toxinidir}/docs {toxinidir}/docs/_build/html
204
205[testenv:pyinstaller]
206# We override this to pass --no-use-pep517 because pyinstaller (3.4, at least)
207# is broken when this feature is enabled.
208install_command = python -m pip install --no-use-pep517 {opts} {packages}
209extras =
210deps =
211    {[testenv]deps}
212    packaging
213    # PyInstaller 4.0 drops Python 2 support.  When we finish porting to
214    # Python 3 we can reconsider this constraint.
215    pyinstaller < 4.0
216# Setting PYTHONHASHSEED to a known value assists with reproducible builds.
217# See https://pyinstaller.readthedocs.io/en/stable/advanced-topics.html#creating-a-reproducible-build
218setenv=PYTHONHASHSEED=1
219commands=
220    pip freeze
221    pyinstaller -y --clean pyinstaller.spec
222
223[testenv:tarballs]
224deps =
225commands =
226         python setup.py update_version
227         python setup.py sdist --formats=bztar,gztar,zip bdist_wheel
Note: See TracBrowser for help on using the repository browser.