diff --git a/tox.ini b/tox.ini index a269cb57f5..1e22ab1e8a 100644 --- a/tox.ini +++ b/tox.ini @@ -12,15 +12,23 @@ minversion = 3.14.0 deps = -rrequirements/tests.in commands_pre = - {envpython} -m \ + {envpython} \ + {[python-cli-options]byteerrors} \ + {[python-cli-options]isolate} \ + -m \ OpenSSL.debug commands = - {envpython} -m \ + {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/' \ @@ -48,6 +56,14 @@ setenv = 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 @@ -71,7 +87,10 @@ commands = # 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} -m sphinx \ + {envpython} \ + {[python-cli-options]byteerrors} \ + {[python-cli-options]isolate} \ + -m sphinx \ -j auto \ -b html \ {tty:--color} \ @@ -83,7 +102,10 @@ commands = "{envdir}/docs_out" # Print out the output docs dir and a way to serve html: - -{envpython} -c\ + -{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";\ @@ -106,8 +128,11 @@ commands = -git fetch --unshallow -git fetch --tags - # Spellcheck docs site: - python -m sphinx \ + # Doctest docs site: + {envpython} \ + {[python-cli-options]byteerrors} \ + {[python-cli-options]isolate} \ + -m sphinx \ -j auto \ -a -n -W \ --keep-going \ @@ -129,8 +154,11 @@ commands = -git fetch --unshallow -git fetch --tags - # Spellcheck docs site: - python -m sphinx \ + # Linkcheck docs site: + {envpython} \ + {[python-cli-options]byteerrors} \ + {[python-cli-options]isolate} \ + -m sphinx \ -j auto \ -a -n -W \ --keep-going \ @@ -153,7 +181,10 @@ commands = -git fetch --tags # Spellcheck docs site: - python -m sphinx \ + {envpython} \ + {[python-cli-options]byteerrors} \ + {[python-cli-options]isolate} \ + -m sphinx \ -j auto \ -a -n -W \ --keep-going \ @@ -179,8 +210,14 @@ deps = usedevelop = False commands_pre = commands = - python -m twine check .tox/dist/* - python -m setuptools_scm ls + {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] @@ -193,7 +230,10 @@ setenv = {[dists]setenv} commands_pre = commands = - {envpython} -c \ + {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))' @@ -211,6 +251,8 @@ platform = darwin|linux install_command = env PIP_CONSTRAINT= \ {envpython} \ + {[python-cli-options]byteerrors} \ + {[python-cli-options]isolate} \ {toxinidir}/bin/pip-wrapper \ '{envname}' \ '{toxinidir}/requirements/' \ @@ -231,7 +273,10 @@ commands = # 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} -m build \ + {envpython} \ + {[python-cli-options]byteerrors} \ + {[python-cli-options]isolate} \ + -m build \ --outdir '{env:PEP517_OUT_DIR}/' \ {posargs:{env:PEP517_BUILD_ARGS:}} \ '{toxinidir}' @@ -251,7 +296,10 @@ commands_pre = setenv = {[dists]setenv} commands = - {envpython} -m twine check \ + {envpython} \ + {[python-cli-options]byteerrors} \ + {[python-cli-options]isolate} + -m twine check \ --strict \ {env:PEP517_OUT_DIR}/* @@ -267,6 +315,13 @@ setenv = TWINE_USERNAME = {env:TWINE_USERNAME:__token__} commands_pre = commands = - python -c "import path; path.Path('dist').rmtree_p()" - python -m pep517.build . - python -m twine upload dist/* + {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/*