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