Skip to content

Commit

Permalink
Merge pull request #1592 from greghope667/update-tox-v4
Browse files Browse the repository at this point in the history
Update tox to version 4
  • Loading branch information
sammdot authored Mar 12, 2023
2 parents 5f98f27 + 6327306 commit 9057504
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 47 deletions.
20 changes: 10 additions & 10 deletions doc/developer_guide.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# Environment setup

You need Python >= 3.7 installed, and you need [tox](https://pypi.org/project/tox/) >= 3.10.
You need Python >= 3.7 installed, and you need [tox](https://pypi.org/project/tox/) >= 4.0.

Using tox takes care of all the details of creating and managing an isolated
virtual environment, installing the necessary dependencies, and isolating
testsuite runs.

The command for using tox is: `tox {-e envlist} {-- arguments}`. Use `tox -a
The command for using tox is: `tox r {-e envlist} {-- arguments}`. Use `tox -a
-v` to get a list of available environments.

The same virtual environment is reused by the following tox environments:
- `tox -e test -- ARGS`: run the testsuite. This is the default environment
- `tox r -e test -- ARGS`: run the testsuite. This is the default environment
when not provided.
- `tox -e launch -- ARGS`: run Plover from source.
- `tox -e setup -- COMMAND`: run `./setup.py COMMAND`.
- `tox -e packaging_checks`: run the same packaging checks as the CI (add `--
- `tox r -e launch -- ARGS`: run Plover from source.
- `tox r -e setup -- COMMAND`: run `./setup.py COMMAND`.
- `tox r -e packaging_checks`: run the same packaging checks as the CI (add `--
-n` to see a dry-run of the exact checks).
- `tox -e plugins_install`: install the distribution plugins (or the specified
- `tox r -e plugins_install`: install the distribution plugins (or the specified
plugins when run with `tox -e plugins_install -- REQS`). Note that this does
not use the plugins manager for installing.
- `tox -e release_prepare -- NEW_VERSION`: execute all the steps necessary for
- `tox r -e release_prepare -- NEW_VERSION`: execute all the steps necessary for
preparing a new release: patch the version to `NEW_VERSION` and update
`NEWS.md`, staging all the changes for review.
- `tox -e release_finalize`: finalize the release: commit the staged changes,
- `tox r -e release_finalize`: finalize the release: commit the staged changes,
create an annotated tag, and print the git command necessary for pushing the
release to GitHub.

Expand All @@ -31,7 +31,7 @@ any other virtual environment](https://virtualenv.pypa.io/en/latest/user_guide.h

The configuration also provides support for lightweight tests only environment:
`pyX`, where `X` is the version of the Python interpreter to use. E.g. running
`tox -e 'py3{6,7,8,9}` will execute the testsuite for each version of Python we
`tox r -e 'py3,py36,py37,py38,py39` will execute the testsuite for each version of Python we
support.


Expand Down
1 change: 1 addition & 0 deletions news.d/feature/1592.core.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
updated config to use tox4
58 changes: 21 additions & 37 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[tox]
minversion = 3.10
minversion = 4.0
envlist = test

[helpers]
functions.sh =
functions =
bash --noprofile --norc -eo pipefail -c ' \
. ./plover_build_utils/functions.sh; \
python=python; \
Expand All @@ -27,28 +27,17 @@ extras =
gui_qt
log
deps =
-c
reqs/constraints.txt
-r
reqs/bootstrap.txt
-r
reqs/build.txt
-r
reqs/ci.txt
-r
reqs/dist.txt
-r
reqs/dist_extra_gui_qt.txt
-r
reqs/dist_extra_log.txt
-r
reqs/packaging.txt
-r
reqs/release.txt
-r
reqs/setup.txt
-r
reqs/test.txt
-c reqs/constraints.txt
-r reqs/bootstrap.txt
-r reqs/build.txt
-r reqs/ci.txt
-r reqs/dist.txt
-r reqs/dist_extra_gui_qt.txt
-r reqs/dist_extra_log.txt
-r reqs/packaging.txt
-r reqs/release.txt
-r reqs/setup.txt
-r reqs/test.txt
install_command = {[helpers]install_command} {packages}
list_dependencies_command = {envpython} -m pip freeze --all
allowlist_externals = bash
Expand All @@ -66,20 +55,15 @@ envdir = {toxworkdir}/{envname}
extras =
gui_qt
deps =
-c
reqs/constraints.txt
-r
reqs/bootstrap.txt
-r
reqs/dist.txt
-r
reqs/setup.txt
-r
reqs/test.txt
-c reqs/constraints.txt
-r reqs/bootstrap.txt
-r reqs/dist.txt
-r reqs/setup.txt
-r reqs/test.txt
setenv =
{[testenv:test]setenv}
commands =
{[testenv:test]commands}
{envpython} -m pytest {posargs}

[testenv:launch]
description = launch plover
Expand All @@ -95,7 +79,7 @@ description = packaging sanity checks
setenv =
PIP_FIND_LINKS={toxinidir}/.cache/wheels
commands =
{[helpers]functions.sh} -- packaging_checks {posargs}
{[helpers]functions} -- packaging_checks {posargs}

[testenv:plugins_install]
description = install plugins into the environment
Expand All @@ -106,7 +90,7 @@ commands =
description = prepare/finalize a release
passenv = *
commands =
{[helpers]functions.sh} -- {envname} {posargs}
{[helpers]functions} -- {envname} {posargs}

[testenv:setup]
description = run a `setup.py` command
Expand Down

0 comments on commit 9057504

Please sign in to comment.