11 skip_missing_interpreters = true
12 ignore_basepython_conflict = true
16 addopts = -p no:warnings
20 deps = -r{toxinidir}/requirements-test.txt
25 [testenv:{build,clean}]
27 build: Build the package in isolation according to PEP517, see https://github.com/pypa/build
28 clean: Remove old distribution files and temporary build artifacts (./build and ./dist)
29 # https://setuptools.pypa.io/en/stable/build_meta.html#how-to-use-it
31 changedir = {toxinidir}
33 build: build[virtualenv]
37 clean: python -c 'import shutil; [shutil.rmtree(p, True) for p in ("build", "dist", "docs/_build")]'
38 clean: python -c 'import pathlib, shutil; [shutil.rmtree(p, True) for p in pathlib.Path("src").glob("*.egg-info")]'
39 build: python -m build {posargs}
40 # By default, both `sdist` and `wheel` are built. If your sdist is too big or you don't want
41 # to make it available, consider running: `tox -e build -- --wheel`
45 description = Build the documentation with sphinx
47 deps = -rrequirements-docs.txt
49 commands = sphinx-build -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
51 [testenv:docs-linkcheck]
52 description = Check the documentation links with sphinx
54 deps = -rrequirements-docs.txt
56 commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck
58 [testenv:latest-upstream]
59 description = Latest upstream test. Used for what exactly?
61 deps = -r{toxinidir}/requirements-test.txt
63 pip install -U python-jenkins requests
67 description = Check all files for license header
71 lftools license check-dir lftools
72 lftools license check-dir -r '.+' shell
75 description = Precommit checks for black, gitlint, etc.
76 basepython = python3.7
83 pre-commit run --all-files --show-diff-on-failure
84 /bin/sh -c 'if ! git config --get user.name > /dev/null; then \
85 git config --global --add user.name "CI"; \
86 touch .git/REMOVE_USERNAME; fi'
87 /bin/sh -c 'if ! git config --get user.email > /dev/null; then \
88 git config --global --add user.email "ci@example.org"; \
89 touch .git/REMOVE_USEREMAIL; fi'
90 /bin/sh -c "if [ -f .git/COMMIT_EDITMSG ]; then \
91 cp .git/COMMIT_EDITMSG .git/COMMIT_MSGTOX; else \
92 git log HEAD -n1 --pretty=%B > .git/COMMIT_MSGTOX; fi"
93 pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_MSGTOX
94 /bin/sh -c "rm -f .git/COMMIT_MSGTOX"
95 /bin/sh -c "if [ -f .git/REMOVE_USERNAME ]; then \
96 git config --global --unset user.name; \
97 rm -f .git/REMOVE_USERNAME; fi"
98 /bin/sh -c "if [ -f .git/REMOVE_USEREMAIL ]; then \
99 git config --global --unset user.email; \
100 rm -f .git/REMOVE_USEREMAIL; fi"
105 Publish the package you have been developing to a package index server.
106 By default, it uses testpypi. If you really want to publish your package
107 to be publicly accessible in PyPI, use the `-- --repository pypi` option.
109 changedir = {toxinidir}
111 # See: https://twine.readthedocs.io/en/latest/
118 python -m twine check dist/*
119 python -m twine upload {posargs:--repository {env:TWINE_REPOSITORY:testpypi}} dist/*
123 description = OpenStack Reno checks
126 commands = reno {posargs:--help}