Sylvain Desbureaux | 3c393e5 | 2020-12-07 09:15:19 +0100 | [diff] [blame] | 1 | [tox] |
| 2 | minversion = 1.6 |
| 3 | envlist = |
Sylvain Desbureaux | ec07bca | 2020-12-09 10:13:42 +0100 | [diff] [blame] | 4 | docs, |
| 5 | docs-linkcheck, |
Sylvain Desbureaux | 3c393e5 | 2020-12-07 09:15:19 +0100 | [diff] [blame] | 6 | gitlint, |
Guillaume Lambert | 85b1492 | 2021-03-12 13:53:18 +0100 | [diff] [blame] | 7 | checkbashisms, |
guillaume.lambert | 30ec390 | 2021-09-14 12:32:24 +0200 | [diff] [blame] | 8 | pre-commit, |
Sylvain Desbureaux | 3c393e5 | 2020-12-07 09:15:19 +0100 | [diff] [blame] | 9 | skipsdist=true |
| 10 | |
Sylvain Desbureaux | ec07bca | 2020-12-09 10:13:42 +0100 | [diff] [blame] | 11 | [doc8] |
| 12 | ignore-path-errors=docs/helm-search.txt;D001 |
| 13 | |
| 14 | [testenv:doc8] |
Cédric Ollivier | 92cdf22 | 2022-08-31 22:01:39 +0200 | [diff] [blame] | 15 | basepython = python3.8 |
Cédric Ollivier | d242150 | 2021-09-28 16:26:56 +0200 | [diff] [blame] | 16 | deps = |
| 17 | -r{toxinidir}/requirements.txt |
Cédric Ollivier | 92cdf22 | 2022-08-31 22:01:39 +0200 | [diff] [blame] | 18 | -chttps://raw.githubusercontent.com/openstack/requirements/stable/yoga/upper-constraints.txt |
Cédric Ollivier | d242150 | 2021-09-28 16:26:56 +0200 | [diff] [blame] | 19 | -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt |
Sylvain Desbureaux | ec07bca | 2020-12-09 10:13:42 +0100 | [diff] [blame] | 20 | commands = |
guillaume.lambert | f3319a8 | 2021-09-26 21:37:50 +0200 | [diff] [blame] | 21 | - doc8 docs/ |
Sylvain Desbureaux | ec07bca | 2020-12-09 10:13:42 +0100 | [diff] [blame] | 22 | |
| 23 | [testenv:docs] |
Cédric Ollivier | 92cdf22 | 2022-08-31 22:01:39 +0200 | [diff] [blame] | 24 | basepython = python3.8 |
Cédric Ollivier | d242150 | 2021-09-28 16:26:56 +0200 | [diff] [blame] | 25 | deps = |
| 26 | -r{toxinidir}/requirements.txt |
Cédric Ollivier | 92cdf22 | 2022-08-31 22:01:39 +0200 | [diff] [blame] | 27 | -chttps://raw.githubusercontent.com/openstack/requirements/stable/yoga/upper-constraints.txt |
Cédric Ollivier | d242150 | 2021-09-28 16:26:56 +0200 | [diff] [blame] | 28 | -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt |
Sylvain Desbureaux | ec07bca | 2020-12-09 10:13:42 +0100 | [diff] [blame] | 29 | commands = |
guillaume.lambert | 91df0d8 | 2021-04-24 10:37:53 +0200 | [diff] [blame] | 30 | sphinx-build -q -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html |
Sylvain Desbureaux | ec07bca | 2020-12-09 10:13:42 +0100 | [diff] [blame] | 31 | |
| 32 | [testenv:docs-linkcheck] |
Cédric Ollivier | 92cdf22 | 2022-08-31 22:01:39 +0200 | [diff] [blame] | 33 | basepython = python3.8 |
Cédric Ollivier | d242150 | 2021-09-28 16:26:56 +0200 | [diff] [blame] | 34 | deps = |
| 35 | -r{toxinidir}/requirements.txt |
Cédric Ollivier | 92cdf22 | 2022-08-31 22:01:39 +0200 | [diff] [blame] | 36 | -chttps://raw.githubusercontent.com/openstack/requirements/stable/yoga/upper-constraints.txt |
Cédric Ollivier | d242150 | 2021-09-28 16:26:56 +0200 | [diff] [blame] | 37 | -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt |
guillaume.lambert | 91df0d8 | 2021-04-24 10:37:53 +0200 | [diff] [blame] | 38 | commands = sphinx-build -q -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck |
Sylvain Desbureaux | ec07bca | 2020-12-09 10:13:42 +0100 | [diff] [blame] | 39 | |
Guillaume Lambert | b825e91 | 2021-02-01 21:22:33 +0100 | [diff] [blame] | 40 | [testenv:spelling] |
Cédric Ollivier | 92cdf22 | 2022-08-31 22:01:39 +0200 | [diff] [blame] | 41 | basepython = python3.8 |
Matthew Watkins | 465aee0 | 2023-04-05 11:01:07 +0100 | [diff] [blame] | 42 | allowlist_externals = wget |
Guillaume Lambert | b825e91 | 2021-02-01 21:22:33 +0100 | [diff] [blame] | 43 | deps = |
Cédric Ollivier | d242150 | 2021-09-28 16:26:56 +0200 | [diff] [blame] | 44 | -r{toxinidir}/requirements.txt |
Cédric Ollivier | 92cdf22 | 2022-08-31 22:01:39 +0200 | [diff] [blame] | 45 | -chttps://raw.githubusercontent.com/openstack/requirements/stable/yoga/upper-constraints.txt |
Cédric Ollivier | d242150 | 2021-09-28 16:26:56 +0200 | [diff] [blame] | 46 | -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt |
Guillaume Lambert | b825e91 | 2021-02-01 21:22:33 +0100 | [diff] [blame] | 47 | changedir={toxinidir}/docs |
| 48 | commands = |
Guillaume Lambert | 089ba21 | 2021-02-10 11:48:39 +0100 | [diff] [blame] | 49 | wget -nv https://git.onap.org/doc/plain/docs/spelling_wordlist.txt -O spelling_wordlist.txt |
Guillaume Lambert | b825e91 | 2021-02-01 21:22:33 +0100 | [diff] [blame] | 50 | sphinx-build -b spelling -d {envtmpdir}/doctrees . _build/spelling |
| 51 | |
Sylvain Desbureaux | 3c393e5 | 2020-12-07 09:15:19 +0100 | [diff] [blame] | 52 | [testenv:gitlint] |
Cédric Ollivier | 92cdf22 | 2022-08-31 22:01:39 +0200 | [diff] [blame] | 53 | basepython = python3.8 |
Sylvain Desbureaux | 3c393e5 | 2020-12-07 09:15:19 +0100 | [diff] [blame] | 54 | deps = |
Cédric Ollivier | d242150 | 2021-09-28 16:26:56 +0200 | [diff] [blame] | 55 | -r{toxinidir}/requirements.txt |
Cédric Ollivier | 92cdf22 | 2022-08-31 22:01:39 +0200 | [diff] [blame] | 56 | -chttps://raw.githubusercontent.com/openstack/requirements/stable/yoga/upper-constraints.txt |
Cédric Ollivier | d242150 | 2021-09-28 16:26:56 +0200 | [diff] [blame] | 57 | -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt |
Sylvain Desbureaux | 3c393e5 | 2020-12-07 09:15:19 +0100 | [diff] [blame] | 58 | commands = |
| 59 | gitlint |
| 60 | |
Guillaume Lambert | d8eab71 | 2021-03-08 21:49:28 +0100 | [diff] [blame] | 61 | [testenv:checkbashisms] |
| 62 | deps = |
Matthew Watkins | 465aee0 | 2023-04-05 11:01:07 +0100 | [diff] [blame] | 63 | allowlist_externals = |
guillaume.lambert | d09f363 | 2021-12-10 21:17:30 +0100 | [diff] [blame] | 64 | {toxinidir}/.ci/check-bashisms.sh |
Guillaume Lambert | d8eab71 | 2021-03-08 21:49:28 +0100 | [diff] [blame] | 65 | commands = |
guillaume.lambert | d09f363 | 2021-12-10 21:17:30 +0100 | [diff] [blame] | 66 | {toxinidir}/.ci/check-bashisms.sh |
Guillaume Lambert | d8eab71 | 2021-03-08 21:49:28 +0100 | [diff] [blame] | 67 | |
guillaume.lambert | 73f3459 | 2021-12-10 20:26:19 +0100 | [diff] [blame] | 68 | [testenv:shellcheck] |
| 69 | basepython = python3 |
| 70 | deps = shellcheck-py |
Matthew Watkins | 465aee0 | 2023-04-05 11:01:07 +0100 | [diff] [blame] | 71 | allowlist_externals = find |
guillaume.lambert | 73f3459 | 2021-12-10 20:26:19 +0100 | [diff] [blame] | 72 | commands = |
| 73 | find . -not -path '*/\.*' -name *.sh -exec shellcheck \{\} + |
| 74 | |
Guillaume Lambert | 056b2d4 | 2021-02-17 12:09:47 +0100 | [diff] [blame] | 75 | [testenv:autopep8] |
Cédric Ollivier | 92cdf22 | 2022-08-31 22:01:39 +0200 | [diff] [blame] | 76 | basepython = python3.8 |
Cédric Ollivier | d242150 | 2021-09-28 16:26:56 +0200 | [diff] [blame] | 77 | deps = |
| 78 | -r{toxinidir}/requirements.txt |
Cédric Ollivier | 92cdf22 | 2022-08-31 22:01:39 +0200 | [diff] [blame] | 79 | -chttps://raw.githubusercontent.com/openstack/requirements/stable/yoga/upper-constraints.txt |
Cédric Ollivier | d242150 | 2021-09-28 16:26:56 +0200 | [diff] [blame] | 80 | -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt |
Guillaume Lambert | 056b2d4 | 2021-02-17 12:09:47 +0100 | [diff] [blame] | 81 | commands = |
| 82 | autopep8 --max-line-length 120 --in-place --recursive kubernetes/ TOSCA/ docs/ |
| 83 | |
| 84 | [testenv:pylint] |
Cédric Ollivier | 92cdf22 | 2022-08-31 22:01:39 +0200 | [diff] [blame] | 85 | basepython = python3.8 |
Cédric Ollivier | d242150 | 2021-09-28 16:26:56 +0200 | [diff] [blame] | 86 | deps = |
| 87 | -r{toxinidir}/requirements.txt |
Cédric Ollivier | 92cdf22 | 2022-08-31 22:01:39 +0200 | [diff] [blame] | 88 | -chttps://raw.githubusercontent.com/openstack/requirements/stable/yoga/upper-constraints.txt |
Cédric Ollivier | d242150 | 2021-09-28 16:26:56 +0200 | [diff] [blame] | 89 | -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt |
Matthew Watkins | 465aee0 | 2023-04-05 11:01:07 +0100 | [diff] [blame] | 90 | allowlist_externals = find |
Guillaume Lambert | 056b2d4 | 2021-02-17 12:09:47 +0100 | [diff] [blame] | 91 | commands = |
| 92 | find kubernetes/ TOSCA/ docs/ -name *.py -exec pylint --max-line-length=120 --disable=missing-docstring --method-rgx="(([a-z_][a-zA-Z0-9_]{2,})|(_[a-z0-9_]*)|(__[a-zA-Z][a-zA-Z0-9_]+__))$" --variable-rgx="[a-zA-Z_][a-zA-Z0-9_]{1,30}$" --reports=y --score=y --output-format=colorized \{\} + |
| 93 | |
guillaume.lambert | 30ec390 | 2021-09-14 12:32:24 +0200 | [diff] [blame] | 94 | [testenv:pre-commit-install] |
| 95 | basepython = python3 |
| 96 | deps = pre-commit |
| 97 | commands = |
| 98 | pre-commit install |
| 99 | pre-commit install --hook-type commit-msg |
| 100 | |
| 101 | [testenv:pre-commit-uninstall] |
| 102 | basepython = python3 |
| 103 | deps = pre-commit |
| 104 | commands = |
| 105 | pre-commit uninstall |
| 106 | pre-commit uninstall --hook-type commit-msg |
| 107 | |
| 108 | [testenv:pre-commit] |
| 109 | basepython = python3 |
| 110 | deps = pre-commit |
| 111 | passenv = HOME |
| 112 | commands = |
| 113 | pre-commit run --all-files --show-diff-on-failure |
| 114 | pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG |
| 115 | # Gitlint only proposes a pre-commit configuration for the commit-msg stage but none for the commit stage. |
| 116 | # Its default arguments --passed and --msg-filename are different from CI recommandations. |
| 117 | # As a result, the line above is always skipped in jenkins CI since there cannot be a .git/COMMIT_EDITMSG file. |
| 118 | # A dedicated gitlint profile for CI is proposed above. Also to behave fine locally, this profile must have access |
| 119 | # to the HOME variable so that Gitlint can retrieve Git user settings. |
guillaume.lambert | 296fa7f | 2021-12-10 20:28:24 +0100 | [diff] [blame] | 120 | |
| 121 | [testenv:pre-commit-autoupdate] |
| 122 | basepython = python3 |
| 123 | deps = pre-commit |
| 124 | commands = |
| 125 | pre-commit autoupdate |