Skip to content

Commit 7a33c14

Browse files
EliahKaganclaude
andcommitted
build(tox): don't install GitPython in the ruff, format, misc envs
The tox `ruff`, `format`, and `misc` environments only run tools on the source tree: `ruff check`, `ruff format --check`, and the remaining pre-commit hooks. But they did not set `skip_install`, so they inherited the default of installing GitPython with `extras = test` from `[testenv]`. That has always been unneeded work, but it became a real obstacle when 212573b (gitpython-developers#2274) added GixPython to the `test` extra for Python 3.11 and later. GixPython 0.3.0 publishes wheels only for macOS, so on Linux and Windows installing it builds its source distribution, which needs Rust 1.89 or newer and a linker. So on those platforms, running Ruff through tox needed a Rust toolchain whenever 3.10 was not found but 3.11 or 3.12 was, since tox then picked one of those for these environments. Set `skip_install = true` in all three environments. `ruff` and `format` already list `ruff` in `deps`. `misc` got `pre-commit` from the `test` extra, so list it in `deps` instead. Like the `test` extra's entry, it is unversioned. The pre-commit hooks themselves are installed by pre-commit into its own environments as before. Run locally with tox 4.67.1, each environment now installs only `ruff` or `pre-commit` and passes, with `misc` running every non-Ruff hook. `ruff` and `format` each took about 1.5 seconds, compared with about 12 seconds for `ruff` before, most of which went to installing the `test` extra. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 646119a commit 7a33c14

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎tox.ini‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ commands = python -I -c "import git; from git import _backend; assert _backend.n
2020
[testenv:ruff]
2121
description = Lint with Ruff
2222
base_python = py{39,310,311,312,38}
23+
skip_install = true
2324
deps = ruff
2425
set_env =
2526
CLICOLOR_FORCE = 1 # Set NO_COLOR to override this.
@@ -37,6 +38,7 @@ commands = python test/run-local.py {posargs:--backend-report=.cache/gix-coverag
3738
[testenv:format]
3839
description = Check formatting with Ruff
3940
base_python = py{39,310,311,312,38}
41+
skip_install = true
4042
deps = ruff
4143
set_env =
4244
CLICOLOR_FORCE = 1 # Set NO_COLOR to override this.
@@ -63,6 +65,8 @@ commands =
6365
[testenv:misc]
6466
description = Run other checks via pre-commit
6567
base_python = py{39,310,311,312,38}
68+
skip_install = true
69+
deps = pre-commit
6670
set_env =
6771
SKIP = ruff-format,ruff-check
6872
commands = pre-commit run --all-files

0 commit comments

Comments
 (0)