Repository navigation
Commit fa1843d
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, the test fails
with "Could not find a version that satisfies the requirement
setuptools>=40.8.0 (from versions: none)", locally and in the weekly
`tox` workflow alike. 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 ce16309 commit fa1843d
3 files changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
191 | 198 | | |
192 | 199 | | |
193 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
| 222 | + | |
| 223 | + | |
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
0 commit comments