Skip to content

Commit

Permalink
Require tox v4 and remove skipsdist/use_develop
Browse files Browse the repository at this point in the history
The testenv section has `usdevelop = True` which imples skipping sdist.

In tox v4, `skipsdist = True` takes precedence over `usedevelop`and
results in the package never being installed even in `check`.

Require tox 4 version via `minversion = 4`. tox v3 will automatically
provision a environment with an upgraded version of tox, based on my
testing that raises:

   ConfigError: envdir must not equal toxinidir

Which is due to `envdir` having multiple settings and lacking an entry
for the special `.tox` environment to install tox v4 within. This set
envdir to `.tox/.pkg` which is the value used by tox v4.

Replace usage of `skipsdist`/`use_develop` which conflicts with each
other in favor of tox v4 setting `package`.

Bug: T346238
Bug: T345695
Depends-On: Ibe0492836e541d75ad84df22bedeb7c4d1bae9b2
Change-Id: I316cefef9d410c25ead3af78439170908a479c69
  • Loading branch information
hashar committed Sep 22, 2023
1 parent 8e5ab8d commit 6b8a8f0
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
[tox]
minversion = 4
envlist = check, py3-lint, black, py3-unit, integration

[tox:jenkins]
envlist = check, py{37,38,39}-{lint}, black, py{37,38,39}-{unit}, doc

[testenv]
skipsdist = True
usedevelop = True

package = editable
# envs can be listed with:
#
# tox -a -v
# tox list
#
# For Jenkins override you need to install in your environment:
# https://gerrit.wikimedia.org/r/integration/tox-jenkins-override.git#egg=tox-jenkins-override
# Then:
# JENKINS_URL=1 tox -a -v
#
# envs configurations can be checked via:
Expand All @@ -33,6 +36,9 @@ description =
doc: Build documentation using Sphinx
venv: Dummy virtualenv to easily run commands
envdir =
# tox v3 provisionining would fail with:
# ConfigError:envdir must not equal toxinidir
.tox: {toxworkdir}/.pkg
py3-unit: {toxworkdir}/venv-py3
py37-unit: {toxworkdir}/venv-py37
py38-unit: {toxworkdir}/venv-py38
Expand Down Expand Up @@ -64,8 +70,7 @@ args_are_paths = False

[testenv:check]
# So we at least try sdist once
skipsdist = False
usedevelop = False
package = sdist
commands = python setup.py --version
python setup.py check

Expand Down

0 comments on commit 6b8a8f0

Please sign in to comment.