Repository navigation
Commit 84ed4f2
build(tox): let the
`tox -e gix` runs the test suite through `test/run-local.py`, which sets
`PIP_NO_INDEX=1` so that nothing is downloaded during the run, and
points `PIP_FIND_LINKS` at a hand-filled `.cache/gix-wheels` directory.
But `test_installation` installs `./smmap`, `./gitdb`, and GitPython
into a fresh virtual environment, and pip needs `setuptools` from the
package index to build them. So without that directory, as on a fresh
clone, the test fails with "Could not find a version that satisfies
the requirement setuptools>=40.8.0 (from versions: none)". tox itself
has already installed the environment's dependencies from the index by
then, so the restriction only stops this test. The environment and the
runner were added in 212573b (gitpython-developers#2274); a commit message in that PR's
earlier history noted that tox was not available to run it.
Have `run-local.py` keep a `PIP_NO_INDEX` that is already set, as it
already does for `PIP_FIND_LINKS`, and set `PIP_NO_INDEX` to `0` in the
`gix` environment unless it is already set. A set value, including an
empty one, is passed on unchanged, so pip treats it as it would
anywhere else; pip takes an empty value, like `0`, as allowing the
index. Running `run-local.py` directly stays offline by default, and
`PIP_NO_INDEX=1 tox -e gix` still runs offline, though tox then also
installs the environment without the index. The environment keeps the
runner's private Git configuration, Git daemon port, and pytest
temporary directory.
Having the environment run pytest directly, like the other test
environments, would also fix this, with a smaller diff, but would
change more about how the environment runs. Document the new behavior
in `doc/gix-backend.md`.
With tox 4.22.0 and 4.67.1, `tox config -e gix` resolves `PIP_NO_INDEX`
to `0` when it is unset, `1` when it is `1`, and empty when it is empty.
With tox 4.67.1:
- `tox -e gix -- test/test_installation.py` passed.
- With `PIP_NO_INDEX=1`, the test failed as before, and in a new
environment, tox's own installation of its dependencies failed for
lack of an index.
- Run directly with the environment's Python, `run-local.py` failed the
test as before when `PIP_NO_INDEX` was unset, and passed when it was
empty.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>gix env's tests download packages1 parent 7f50cfa commit 84ed4f2
3 files changed
Lines changed: 19 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
191 | 199 | | |
192 | 200 | | |
193 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
| |||
0 commit comments