10 skip_missing_interpreters = true
11 ignore_basepython_conflict = true
18 --cov-report=term-missing
22 # This needs to mirror the test section of pyproject.toml
29 pytest-responses==0.4.0
35 [testenv:{build,clean}]
37 build: Build the package in isolation according to PEP517, see https://github.com/pypa/build
38 clean: Remove old distribution files and temporary build artifacts (./build and ./dist)
39 # https://setuptools.pypa.io/en/stable/build_meta.html#how-to-use-it
41 changedir = {toxinidir}
43 build: build[virtualenv]
47 clean: python -c 'import shutil; [shutil.rmtree(p, True) for p in ("build", "dist", "docs/_build")]'
48 clean: python -c 'import pathlib, shutil; [shutil.rmtree(p, True) for p in pathlib.Path("src").glob("*.egg-info")]'
49 build: python -m build {posargs}
50 # By default, both `sdist` and `wheel` are built. If your sdist is too big or you don't want
51 # to make it available, consider running: `tox -e build -- --wheel`
55 description = Build the documentation with sphinx
56 basepython = python3.8
57 # This needs to mirror the docs section of pyproject.toml plus the testenv
62 sphinxcontrib-programoutput
65 commands = sphinx-build -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
67 [testenv:docs-linkcheck]
68 description = Check the documentation links with sphinx
69 basepython = python3.8
73 commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck
75 [testenv:latest-upstream]
76 description = Latest upstream test. Used for what exactly?
81 pip install -U python-jenkins requests
85 description = Check all files for license header
86 basepython = python3.8
89 lftools license check-dir lftools
90 lftools license check-dir -r '.+' shell
93 description = Precommit checks for black, gitlint, etc.
94 basepython = python3.8
101 pre-commit run --all-files --show-diff-on-failure
102 /bin/sh -c 'if ! git config --get user.name > /dev/null; then \
103 git config --global --add user.name "CI"; \
104 touch .git/REMOVE_USERNAME; fi'
105 /bin/sh -c 'if ! git config --get user.email > /dev/null; then \
106 git config --global --add user.email "ci@example.org"; \
107 touch .git/REMOVE_USEREMAIL; fi'
108 /bin/sh -c "if [ -f .git/COMMIT_EDITMSG ]; then \
109 cp .git/COMMIT_EDITMSG .git/COMMIT_MSGTOX; else \
110 git log HEAD -n1 --pretty=%B > .git/COMMIT_MSGTOX; fi"
111 pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_MSGTOX
112 /bin/sh -c "rm -f .git/COMMIT_MSGTOX"
113 /bin/sh -c "if [ -f .git/REMOVE_USERNAME ]; then \
114 git config --global --unset user.name; \
115 rm -f .git/REMOVE_USERNAME; fi"
116 /bin/sh -c "if [ -f .git/REMOVE_USEREMAIL ]; then \
117 git config --global --unset user.email; \
118 rm -f .git/REMOVE_USEREMAIL; fi"
123 Publish the package you have been developing to a package index server.
124 By default, it uses testpypi. If you really want to publish your package
125 to be publicly accessible in PyPI, use the `-- --repository pypi` option.
127 changedir = {toxinidir}
129 # See: https://twine.readthedocs.io/en/latest/
136 python -m twine check dist/*
137 python -m twine upload {posargs:--repository {env:TWINE_REPOSITORY:testpypi}} dist/*
141 description = OpenStack Reno checks
144 commands = reno {posargs:--help}