Skip to content

Commit 0342c33

Browse files
authored
Switch to tox 4 (#1020)
* Update tox.ini to work with tox 4 - remove `skipsdist = True` (tox 4 will not install bandit with this setting, not even in editable mode for environments where `usedevelop = True` is set), add `skip_install = true` to the pep8 job - remove `requires = tox<4` - use multi-line list for `passenv` - add the `-` mark to ignore pylint exit code in the pep8 job - although this mark is already present in `[testenv:pylint]`, tox 4 ignores it when using the `{[testenv:pylint]commands}` substitution * Use the `tox run` command In tox 4, environments should always be specified using the -e flag to the `run` subcommand. https://tox.wiki/en/4.4.11/upgrading.html#updating-usage-with-e
1 parent c4da1cb commit 0342c33

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
pip install -r test-requirements.txt
2323
pip install tox
2424
- name: Run tox
25-
run: tox -e format
25+
run: tox run -e format
2626

2727
pep8:
2828
runs-on: ubuntu-latest
@@ -45,7 +45,7 @@ jobs:
4545
pip install -r test-requirements.txt
4646
pip install tox
4747
- name: Run tox
48-
run: tox -e pep8
48+
run: tox run -e pep8
4949

5050
tests:
5151
strategy:
@@ -70,4 +70,4 @@ jobs:
7070
pip install -r test-requirements.txt
7171
pip install tox
7272
- name: Run tox
73-
run: tox -e py${{ matrix.python-version[1] }}
73+
run: tox run -e py${{ matrix.python-version[1] }}

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ You can test any changes with tox:
6363

6464
```shell script
6565
pip install tox
66-
tox -e pep8
67-
tox -e py37
68-
tox -e docs
69-
tox -e cover
66+
tox run -e pep8
67+
tox run -e py37
68+
tox run -e docs
69+
tox run -e cover
7070
```
7171
If everything is done, proceed with [opening a new pull request](https://help.github.com/en/desktop/contributing-to-projects/creating-a-pull-request)
7272

tox.ini

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
[tox]
22
minversion = 3.2.0
33
envlist = py37,pep8
4-
skipsdist = True
5-
requires =
6-
tox<4
74

85
[testenv]
96
usedevelop = True
@@ -18,7 +15,13 @@ commands =
1815
stestr run {posargs}
1916
allowlist_externals =
2017
find
21-
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
18+
passenv =
19+
http_proxy
20+
HTTP_PROXY
21+
https_proxy
22+
HTTPS_PROXY
23+
no_proxy
24+
NO_PROXY
2225

2326
[testenv:debug]
2427
commands = oslo_debug_helper -t tests {posargs}
@@ -31,13 +34,14 @@ commands = flake8 {posargs} bandit
3134
bandit-baseline -r bandit -ll -ii
3235

3336
[testenv:pep8]
37+
skip_install = true
3438
ignore_errors = true
3539
deps = {[testenv]deps}
3640
.
3741
usedevelop = False
3842
commands = flake8 {posargs} bandit
3943
flake8 {posargs} tests
40-
{[testenv:pylint]commands}
44+
-{[testenv:pylint]commands}
4145
bandit-baseline -r bandit -ll -ii
4246

4347
[testenv:venv]

0 commit comments

Comments
 (0)