Repository navigation
Commit 4b511bf
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.
Give `run-local.py` an `--allow-index` option, accepted as its first
argument, with which it sets neither `PIP_NO_INDEX` nor
`PIP_FIND_LINKS`, and have the `gix` environment pass it. pip then
follows its own configuration, from environment variables or a pip
configuration file, as tox already does when installing the
environment. Without the option, `run-local.py` disables the index and
points `PIP_FIND_LINKS` at `.cache/gix-wheels` unless it is set, as
before. The environment keeps the runner's private Git configuration,
Git daemon port, and pytest temporary directory. Document this in
`doc/gix-backend.md`.
Having the `gix` environment set `PIP_NO_INDEX=0` would be simpler,
but pip lets environment variables override its configuration files,
so that would also override a `no-index` setting in a pip
configuration file, both in the tests and when tox installs the
environment. For the same reason, the option leaves `PIP_FIND_LINKS`
unset, since its default would override a `find-links` setting. Having
the environment run pytest directly, like the other test environments,
would also fix this, but would change more about how it runs.
Checked with tox 4.67.1:
- `tox config -e gix` shows `--allow-index` before the default
arguments, and before arguments given after `--`.
- `tox -r -e gix -- test/test_installation.py` passed.
- With `PIP_NO_INDEX=1`, and with a pip configuration file (through
`PIP_CONFIG_FILE`) that sets `no-index = true`, the test failed for
lack of an index, and so did tox's own installation of a new
environment.
- With a local directory holding the wheels it needs, the test passed
offline in an existing environment, both with `no-index` and
`find-links` in a pip configuration file and with `PIP_NO_INDEX=1`
and `PIP_FIND_LINKS`.
- Run directly with the environment's Python, `run-local.py` failed
the test as before, even with `PIP_NO_INDEX=0`, and passed with
`--allow-index`.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>gix env's tests use the package index1 parent ef3e8a0 commit 4b511bf
3 files changed
Lines changed: 27 additions & 10 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 | + | |
| 199 | + | |
191 | 200 | | |
192 | 201 | | |
193 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
5 | 9 | | |
6 | 10 | | |
7 | 11 | | |
| |||
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| 22 | + | |
| 23 | + | |
18 | 24 | | |
19 | 25 | | |
20 | 26 | | |
| |||
26 | 32 | | |
27 | 33 | | |
28 | 34 | | |
29 | | - | |
30 | 35 | | |
31 | | - | |
32 | 36 | | |
33 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
| |||
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
46 | | - | |
| 53 | + | |
47 | 54 | | |
48 | 55 | | |
49 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
0 commit comments