Skip to content

Commit 646119a

Browse files
EliahKaganclaude
andcommitted
build(tox): pass GIT_PYTHON_GIT_EXECUTABLE through to environments
Since 212573b (gitpython-developers#2274), GitPython requires Git 2.52 or newer for library-managed operations, and the tests require it too. The README says that Git must be "available in `PATH` or selected with `GIT_PYTHON_GIT_EXECUTABLE`", which lets a developer whose default `git` is older point GitPython at a newer one without changing `PATH`. tox did not support the second way. Its environments only receive the variables tox passes by default plus those in `pass_env`, which listed just `SSH_*`. So `GIT_PYTHON_GIT_EXECUTABLE` set in the shell was silently dropped, and `tox` ran the tests against whatever `git` came first in `PATH`, even when that was too old. Add `GIT_PYTHON_GIT_EXECUTABLE` to `pass_env` in `[testenv]`. Every environment inherits it, including `gix` and the `py38` through `py310` environments that only install and import GitPython, none of which override `pass_env`. `GIT_PYTHON_BACKEND` is still not passed through, since `[testenv]` and `gix` each set it explicitly. Checked locally with tox 4.67.1 by running an environment with its command overridden to print the variable, with `GIT_PYTHON_GIT_EXECUTABLE` set in the calling shell. Before this change it printed `None`; after it, the value that was set. `tox config` shows the variable in `pass_env` for `py311`, `gix`, and `mypy`. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 42a570f commit 646119a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎tox.ini‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ env_list = py{38,39,310,311,312,313,314,315}, ruff, format, mypy, html, misc
66
description = Run unit tests
77
package = wheel
88
extras = test
9-
pass_env = SSH_*
9+
pass_env =
10+
SSH_*
11+
GIT_PYTHON_GIT_EXECUTABLE
1012
set_env = GIT_PYTHON_BACKEND=cli
1113
commands = pytest --color=yes {posargs}
1214

0 commit comments

Comments
 (0)