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 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327
|
[tox]
envlist = python
# FIXME: Bump the min version once Python 3.4 is no longer in the CI
# FIXME: Once Python 3.4 is dropped from the matrix, use `{temp_dir}`
# FIXME: instead of `{toxworkdir}/.tmp` that was added in tox v3.16.1.
# NOTE: The last tox supporting Python 3.4 is 3.14.0
# FIXME: Once Python 3.4 is dropped from the matrix, use `{/}`
# NOTE: The first tox supporting {/} is 3.21.0
minversion = 3.14.0
[testenv]
deps =
-rrequirements/tests.in
commands_pre =
{envpython} \
{[python-cli-options]byteerrors} \
{[python-cli-options]isolate} \
-m \
OpenSSL.debug
commands =
{envpython} \
{[python-cli-options]byteerrors} \
{[python-cli-options]isolate} \
-m \
pytest \
{tty:--color=yes} \
{posargs:}
install_command =
{envpython} \
{[python-cli-options]byteerrors} \
{[python-cli-options]isolate} \
{toxinidir}/bin/pip-wrapper \
'{envname}' \
'{toxinidir}/requirements/' \
install {opts} {packages}
usedevelop = True
passenv =
WEBTEST_INTERACTIVE
CI
TRAVIS
TRAVIS_*
APPVEYOR
APPVEYOR_*
CIRCLECI
CIRCLE_*
PYTHONDONTWRITEBYTECODE
PYTHONTRACEMALLOC
PYTEST_*
SSH_AUTH_SOCK
GITHUB_*
CODECOV_TOKEN
setenv =
CRYPTOGRAPHY_ALLOW_OPENSSL_102=x
PYTHONDONTWRITEBYTECODE=x
WEBTEST_INTERACTIVE=false
[python-cli-options]
byteerrors = -bb
bytewarnings = -b
# isolate = -I
# FIXME: Python 2 shim. Is this equivalent to the above?
isolate = -E -s
[dists]
setenv =
PIP_CONSTRAINT = {toxinidir}/requirements/dist-build-constraints.txt
PEP517_OUT_DIR = {env:PEP517_OUT_DIR:{toxinidir}/dist}
[testenv:build-docs]
allowlist_externals =
git
basepython = python3.8
description = Build The Docs
changedir = docs
commands_pre =
commands =
# Retrieve possibly missing commits:
-git fetch --unshallow
-git fetch --tags
# Build docs site:
# FIXME: Once Python 3.4 is dropped from the matrix, use `{temp_dir}`
# FIXME: instead of `{toxworkdir}/.tmp` that was added in tox v3.16.1.
# NOTE: The last tox supporting Python 3.4 is 3.14.0
# -d "{temp_dir}/.doctrees" \
{envpython} \
{[python-cli-options]byteerrors} \
{[python-cli-options]isolate} \
-m sphinx \
-j auto \
-b html \
{tty:--color} \
-a \
-n \
-W --keep-going \
-d "{toxworkdir}/.tmp/.doctrees" \
. \
"{envdir}/docs_out"
# Print out the output docs dir and a way to serve html:
-{envpython} \
{[python-cli-options]byteerrors} \
{[python-cli-options]isolate} \
-c\
'import pathlib;\
docs_dir = pathlib.Path(r"{envdir}") / "docs_out";\
index_file = docs_dir / "index.html";\
print(f"\nDocumentation available under\
`file://\{index_file\}`\n\nTo serve docs, use\
`python3 -m http.server --directory \
\N\{QUOTATION MARK\}\{docs_dir\}\N\{QUOTATION MARK\} 0`\n")'
deps =
-rrequirements/tox-docs.in
[testenv:doctest-docs]
allowlist_externals =
{[testenv:build-docs]allowlist_externals}
basepython = {[testenv:build-docs]basepython}
description = Doctest The Docs
changedir = {[testenv:build-docs]changedir}
commands_pre =
commands =
# Retrieve possibly missing commits:
-git fetch --unshallow
-git fetch --tags
# Doctest docs site:
{envpython} \
{[python-cli-options]byteerrors} \
{[python-cli-options]isolate} \
-m sphinx \
-j auto \
-a -n -W \
--keep-going \
-b doctest --color \
-d "{toxworkdir}/.tmp/.doctrees" \
. "{toxworkdir}/docs_out"
deps =
{[testenv:build-docs]deps}
[testenv:linkcheck-docs]
allowlist_externals =
{[testenv:build-docs]allowlist_externals}
basepython = {[testenv:build-docs]basepython}
description = Linkcheck The Docs
changedir = {[testenv:build-docs]changedir}
commands_pre =
commands =
# Retrieve possibly missing commits:
-git fetch --unshallow
-git fetch --tags
# Linkcheck docs site:
{envpython} \
{[python-cli-options]byteerrors} \
{[python-cli-options]isolate} \
-m sphinx \
-j auto \
-a -n -W \
--keep-going \
-b linkcheck --color \
-d "{toxworkdir}/.tmp/.doctrees" \
. "{toxworkdir}/docs_out"
deps =
{[testenv:build-docs]deps}
[testenv:spellcheck-docs]
allowlist_externals =
{[testenv:build-docs]allowlist_externals}
basepython = {[testenv:build-docs]basepython}
description = Spellcheck The Docs
changedir = {[testenv:build-docs]changedir}
commands_pre =
commands =
# Retrieve possibly missing commits:
-git fetch --unshallow
-git fetch --tags
# Spellcheck docs site:
{envpython} \
{[python-cli-options]byteerrors} \
{[python-cli-options]isolate} \
-m sphinx \
-j auto \
-a -n -W \
--keep-going \
-b spelling --color \
-d "{toxworkdir}/.tmp/.doctrees" \
. "{toxworkdir}/docs_out"
deps =
-rrequirements/tox-docs-linkcheck.in
[testenv:watch]
commands = ptw --runner=pytest
[testenv:pre-commit]
deps =
-rrequirements/tox-pre-commit.in
commands_pre =
commands = pre-commit run --all-files --show-diff-on-failure {posargs}
[testenv:setup-check]
deps =
setuptools-scm
twine
usedevelop = False
commands_pre =
commands =
{envpython} \
{[python-cli-options]byteerrors} \
{[python-cli-options]isolate} \
-m twine check .tox/dist/*
{envpython} \
{[python-cli-options]byteerrors} \
{[python-cli-options]isolate} \
-m setuptools_scm ls
[testenv:cleanup-dists]
description =
Wipe the the dist/ folder
usedevelop = false
skip_install = true
deps =
setenv =
{[dists]setenv}
commands_pre =
commands =
{envpython} \
{[python-cli-options]byteerrors} \
{[python-cli-options]isolate} \
-c \
'import os, shutil, sys; dists_dir = os.getenv("PEP517_OUT_DIR"); shutil.rmtree(dists_dir, ignore_errors=True); sys.exit(os.path.exists(dists_dir))'
[testenv:build-dists]
allowlist_externals =
env
description =
Build dists and put them into
the `{env:PEP517_OUT_DIR}/` folder
depends =
cleanup-dists
platform = darwin|linux
# NOTE: The custom command is here to allow resetting the global
# NOTE: pip constaints env var.
install_command =
env PIP_CONSTRAINT= \
{envpython} \
{[python-cli-options]byteerrors} \
{[python-cli-options]isolate} \
{toxinidir}/bin/pip-wrapper \
'{envname}' \
'{toxinidir}/requirements/' \
install {opts} {packages}
isolated_build = true
# `usedevelop = true` overrides `skip_install` instruction, it's unwanted
usedevelop = false
skip_install = true
deps =
-rrequirements/tox-build-dists.in
passenv =
PEP517_BUILD_ARGS
setenv =
{[dists]setenv}
commands_pre =
commands =
# Starting with build v0.5.0, it builds wheel from sdist
# if no format arguments are passed. This makes sure that
# wheels are not dependent on the Git repo or anything
# external what may be missing from sdist.
{envpython} \
{[python-cli-options]byteerrors} \
{[python-cli-options]isolate} \
-m build \
--outdir '{env:PEP517_OUT_DIR}/' \
{posargs:{env:PEP517_BUILD_ARGS:}} \
'{toxinidir}'
[testenv:metadata-validation]
description =
Verify that dists under the `{env:PEP517_OUT_DIR}/` dir
have valid metadata
depends =
build-dists
deps =
twine
usedevelop = false
skip_install = true
commands_pre =
setenv =
{[dists]setenv}
commands =
{envpython} \
{[python-cli-options]byteerrors} \
{[python-cli-options]isolate}
-m twine check \
--strict \
{env:PEP517_OUT_DIR}/*
[testenv:release]
skip_install = True
deps =
pep517>=0.5
twine>=1.13
path.py
passenv =
TWINE_PASSWORD
setenv =
TWINE_USERNAME = {env:TWINE_USERNAME:__token__}
commands_pre =
commands =
{envpython} \
{[python-cli-options]byteerrors} \
{[python-cli-options]isolate} \
-c "import path; path.Path('dist').rmtree_p()"
{envpython} \
{[python-cli-options]byteerrors} \
{[python-cli-options]isolate} -m pep517.build .
{envpython} \
{[python-cli-options]byteerrors} \
{[python-cli-options]isolate} -m twine upload dist/*
|