Skip to content

Commit 5bc5127

Browse files
committed
tox: Assorted changes
- Remove the 'linters' testenv: this battle has been lost - Don't install package for the 'pep8' testenv: it's unnecessary - Remove 'safety' from 'pep8' testenv: the command we were using is deprecated and the new one requires authentication - Fix the 'bindep' testenv so it (once again) skips install of the package and do the same for the 'pep8' and 'babel' testenvs - Stop setting 'basepython': everything is Python 3 nowadays (tox 4 *only* supports that) - Remove a linter from the 'test-requirements.txt' file: these dependencies are managed by tox - Fix some indentation Change-Id: I4805d1ac0fa0209c59f3815352ff9ea54108eca2 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
1 parent aa77316 commit 5bc5127

File tree

2 files changed

+24
-41
lines changed

2 files changed

+24
-41
lines changed

test-requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ stestr>=1.0.0 # Apache-2.0
44
testscenarios>=0.4 # Apache-2.0/BSD
55
testtools>=2.2.0 # MIT
66
virtualenv>=14.0.6 # MIT
7-
bashate>=0.5.1 # Apache-2.0

tox.ini

Lines changed: 24 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
[tox]
22
minversion = 4.11.0
33
envlist = validate,py3,pep8,pip-install
4-
ignore_basepython_conflict=true
54

65
[testenv]
7-
basepython = python3
8-
usedevelop = True
9-
deps = -c{toxinidir}/upper-constraints.txt
10-
-r{toxinidir}/requirements.txt
11-
-r{toxinidir}/test-requirements.txt
6+
usedevelop = true
7+
deps =
8+
-c{toxinidir}/upper-constraints.txt
9+
-r{toxinidir}/requirements.txt
10+
-r{toxinidir}/test-requirements.txt
1211
commands =
1312
stestr run {posargs}
1413

@@ -40,72 +39,56 @@ allowlist_externals =
4039
generate-constraints
4140
description = Regenerates upper-constraints.txt
4241
# Generate needs an unconstrained install to get new dependencies
43-
deps = -r{toxinidir}/requirements.txt
44-
-r{toxinidir}/test-requirements.txt
42+
deps =
43+
-r{toxinidir}/requirements.txt
44+
-r{toxinidir}/test-requirements.txt
4545
commands = generate-constraints {posargs: -d denylist.txt -r global-requirements.txt -p python3.9 -p python3.10 -p python3.11 -p python3.12 -p python3.13 > upper-constraints.txt}
4646

4747
[testenv:validate]
4848
allowlist_externals =
4949
validate-constraints
5050
commands =
51-
validate-constraints {toxinidir}/global-requirements.txt {toxinidir}/upper-constraints.txt {toxinidir}/denylist.txt
51+
validate-constraints {toxinidir}/global-requirements.txt {toxinidir}/upper-constraints.txt {toxinidir}/denylist.txt
5252

5353
[testenv:validate-projects]
5454
allowlist_externals =
5555
validate-projects
5656
commands = validate-projects {toxinidir}/projects.txt
5757

58-
# TODO remove once zuul reconfigured to run linters on gate
5958
[testenv:pep8]
60-
deps = {[testenv:linters]deps}
61-
allowlist_externals =
62-
bash
63-
commands =
64-
flake8
65-
bash -c "find {toxinidir}/tools \
66-
-type f \
67-
-name \*.sh \
68-
-print0 | xargs -0 bashate -v -iE006,E010"
69-
bash -c 'sed -e "s,===,==," upper-constraints.txt > {envtmpdir}/safety-check.txt'
70-
-safety check --json -r {envtmpdir}/safety-check.txt
71-
72-
[testenv:linters]
7359
description = Perform linting
60+
skip_install = true
7461
deps =
75-
hacking>=1.0.0
76-
bashate>=0.5.1
77-
safety
62+
hacking~=7.0 # Apache-2.0
63+
bashate~=2.1 # Apache-2.0
7864
allowlist_externals =
7965
bash
8066
commands =
81-
flake8
82-
bash -c "find {toxinidir}/tools \
83-
-type f \
84-
-name \*.sh \
85-
-print0 | xargs -0 bashate -v -iE006,E010"
86-
bash -c 'sed -e "s,===,==," upper-constraints.txt > {envtmpdir}/safety-check.txt'
87-
-safety check --json -r {envtmpdir}/safety-check.txt
67+
flake8
68+
bash -c "find {toxinidir}/tools \
69+
-type f \
70+
-name \*.sh \
71+
-print0 | xargs -0 bashate -v -iE006,E010"
8872

8973
[testenv:bindep]
9074
# Do not install any requirements. We want this to be fast and work even if
9175
# system dependencies are missing, since it's used to tell you what system
92-
# dependencies are missing! This also means that bindep must be installed
93-
# separately, outside of the requirements files, and develop mode disabled
94-
# explicitly to avoid unnecessarily installing the checked-out repo too (this
95-
# further relies on "tox.skipsdist = True" above).
76+
# dependencies are missing!
77+
skip_install = true
9678
deps = bindep
9779
commands = bindep test
9880
usedevelop = False
9981

10082
[testenv:docs]
10183
allowlist_externals =
10284
sphinx-build
103-
deps = -c{env:TOX_CONSTRAINTS_FILE:{toxinidir}/upper-constraints.txt}
104-
-r{toxinidir}/doc/requirements.txt
85+
deps =
86+
-c{env:TOX_CONSTRAINTS_FILE:{toxinidir}/upper-constraints.txt}
87+
-r{toxinidir}/doc/requirements.txt
10588
commands = sphinx-build -W -b html doc/source doc/build/html
10689

10790
[testenv:pip-install]
108-
recreate = True
91+
recreate = true
10992
deps = .
11093
commands = python {toxinidir}/tools/check-install.py
11194

@@ -117,6 +100,7 @@ commands =
117100
{toxinidir}/playbooks/files/project-requirements-change.py --local {posargs}
118101

119102
[testenv:babel]
103+
skip_install = true
120104
# Use the local upper-constraints.txt file
121105
allowlist_externals =
122106
{toxinidir}/tools/babel-test.sh

0 commit comments

Comments
 (0)