Repository navigation
Move [doc] extra to a PEP 735 dependency group; add uv-sync CI check - #2243
Merged
Merged
Conversation
Member
|
Thanks. |
Merged
EliahKagan
added a commit
to EliahKagan/GitPython
that referenced
this pull request
Oct 25, 2026
The documentation build dependencies (Sphinx and its extensions) used to be the `doc` extra. 9e54de4 (gitpython-developers#2243) moved them to a PEP 735 `doc` dependency group in `pyproject.toml`, and CI now installs them with `pip install --group doc`, but the tox `html` environment still asked for the `doc` extra. GitPython no longer has that extra, so `tox -e html` failed before building anything: html: failed with extras not found for package GitPython: doc (available: gix, test) Install the `doc` dependency group with `dependency_groups = doc` instead. `extras =` is set to empty, so the environment still installs only GitPython and the documentation dependencies, as it did with `extras = doc`, rather than inheriting `extras = test` from `[testenv]`. `dependency_groups` was added in tox 4.22, so raise the `requires` floor from `tox>=4` to `tox>=4.22`. With an older tox installed, tox then provisions a new enough one rather than ignoring the setting. Run locally with tox 4.67.1, `tox -e html` now installs the group and builds the HTML documentation successfully. Sphinx reports one warning, about the docstring of `git.objects.submodule.util.is_relative_url`. CI's documentation build reports the same single warning. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
EliahKagan
added a commit
to EliahKagan/GitPython
that referenced
this pull request
Oct 25, 2026
The documentation build dependencies (Sphinx and its extensions) used to be the `doc` extra. 9e54de4 (gitpython-developers#2243) moved them to a PEP 735 `doc` dependency group in `pyproject.toml`, and CI now installs them with `pip install --group doc`, but the tox `html` environment still asked for the `doc` extra. GitPython no longer has that extra, so `tox -e html` failed before building anything: html: failed with extras not found for package GitPython: doc (available: gix, test) Install the `doc` dependency group with `dependency_groups = doc` instead. `extras =` is set to empty, so the environment still installs only GitPython and the documentation dependencies, as it did with `extras = doc`, rather than inheriting `extras = test` from `[testenv]`. `dependency_groups` was added in tox 4.22, so raise the `requires` floor from `tox>=4` to `tox>=4.22`. With an older tox installed, tox then provisions a new enough one rather than ignoring the setting. Run locally with tox 4.67.1, `tox -e html` now installs the group and builds the HTML documentation successfully. Sphinx reports one warning, about the docstring of `git.objects.submodule.util.is_relative_url`. CI's documentation build on Python 3.13 reports the same single warning. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
EliahKagan
added a commit
to EliahKagan/GitPython
that referenced
this pull request
Oct 25, 2026
The main CI does not use tox, so the tox configuration can break without anyone noticing. It has: `tox -e html` stopped working when 9e54de4 (gitpython-developers#2243) removed the `doc` extra, `tox -e misc` has run `ruff check` again since b7ce712 (gitpython-developers#2031) changed that hook's id, and the `base_python` fallbacks have not meant what they said since 62c024e (gitpython-developers#1693). New releases of tox and virtualenv can also change how the configuration behaves, as when tox 4.56.0 made missing interpreters fail. But running every tox environment is too slow for every push and pull request. Add a `tox` workflow that runs on a weekly schedule and through `workflow_dispatch`. Each job runs the tox environments for one Python version, from 3.8 to 3.15, on Ubuntu. 3.8 and 3.9 run on `ubuntu-24.04`, since `setup-python` has no builds of them for Ubuntu 26.04. The 3.12 job also runs `gix`, and the 3.13 job also runs `ruff`, `format`, `mypy`, `html`, and `misc`. The steps that prepare for the tests (Rust for GixPython source builds, current Git from the git-core PPA, `init-tests-after-clone.sh`, and the test Git identity and aliases) are the same as in `pythonpackage.yml`. tox and the plugin used below both need Python 3.11 or later, so `setup-python` also installs Python 3.13, and tox runs on that. tox is installed unpinned, so that the workflow tests the configuration with the tox and virtualenv that a contributor would get. The job has only `contents: read` and uses no secrets. For running tox on GitHub Actions, there are two tox plugins and one action: - `tox-gh`, from the `tox-dev` organization that maintains tox, selects the environments for the job's Python version from a mapping in the tox configuration, puts each environment's output in its own log group, and summarizes the results. - `tox-gh-actions`, an older plugin maintained outside `tox-dev`, does the same with more ways to select environments, and also supports tox 3. This project needs only selection by Python version. - `fedora-python/tox-github-action` runs tox in a Fedora container that has most Python versions, but no longer 3.8. It also pulls its image by a mutable tag, its repository has no license, and it runs tox as root in the container, which would change what GitPython's tests see about file ownership and `safe.directory`. Use `tox-gh`. Selecting environments by version is simple here, but the log groups make long weekly logs easier to read, and it adds little risk, since it comes from the `tox-dev` organization, like tox itself. Its mapping goes in `[tool.tox.gh.python]` in `pyproject.toml`. tox-gh does nothing outside GitHub Actions, and without it, `tox config` only adds a note that `gh` is unused. The job sets `TOX_GH_MAJOR_MINOR` to the matrix version, as tox-gh documents for when tox runs on a different Python. `actionlint`, `zizmor` 1.31.1 (pedantic, with online audits), and `pinact run --check --verify-comment` report nothing for the new workflow, and all pre-commit hooks pass. With `GITHUB_ACTIONS=true` set locally, tox with tox-gh ran only `py38` for `TOX_GH_MAJOR_MINOR=3.8`, in its own log group, and set up `py313`, `ruff`, `format`, `mypy`, `html`, and `misc` for 3.13. The workflow itself has not run on GitHub yet, because `workflow_dispatch` and `schedule` only work once it is on the default branch. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
EliahKagan
added a commit
to EliahKagan/GitPython
that referenced
this pull request
Oct 25, 2026
The documentation build dependencies (Sphinx and its extensions) used to be the `doc` extra. 9e54de4 (gitpython-developers#2243) moved them to a PEP 735 `doc` dependency group in `pyproject.toml`, and CI now installs them with `pip install --group doc`, but the tox `html` environment still asked for the `doc` extra. GitPython no longer has that extra, so `tox -e html` failed before building anything: html: failed with extras not found for package GitPython: doc (available: gix, test) Install the `doc` dependency group with `dependency_groups = doc` instead. `extras =` is set to empty, so the environment still installs only GitPython and the documentation dependencies, as it did with `extras = doc`, rather than inheriting `extras = test` from `[testenv]`. `dependency_groups` was added in tox 4.22, so raise the `requires` floor from `tox>=4` to `tox>=4.22`. With an older tox installed, tox then provisions a new enough one rather than ignoring the setting. Run locally with tox 4.67.1, `tox -e html` now installs the group and builds the HTML documentation successfully, with no Sphinx warnings, as in CI's documentation build on Python 3.13. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
EliahKagan
added a commit
to EliahKagan/GitPython
that referenced
this pull request
Oct 25, 2026
The main CI does not use tox, so the tox configuration can break without anyone noticing. It has: `tox -e html` stopped working when 9e54de4 (gitpython-developers#2243) removed the `doc` extra, `tox -e misc` has run `ruff check` again since b7ce712 (gitpython-developers#2031) changed that hook's id, and the `base_python` fallbacks have not meant what they said since 62c024e (gitpython-developers#1693). New releases of tox and virtualenv can also change how the configuration behaves, as when tox 4.56.0 made missing interpreters fail. But running every tox environment is too slow for every push and pull request. Add a `tox` workflow that runs on a weekly schedule and through `workflow_dispatch`. Each job runs the tox environments for one Python version, from 3.8 to 3.15, on Ubuntu. 3.8 and 3.9 run on `ubuntu-24.04`, since `setup-python` has no builds of them for Ubuntu 26.04. The 3.12 job also runs `gix`, and the 3.13 job also runs `ruff`, `format`, `mypy`, `html`, and `misc`. The steps that prepare for the tests (Rust for GixPython source builds, current Git from the git-core PPA, `init-tests-after-clone.sh`, and the test Git identity and aliases) are the same as in `pythonpackage.yml`. tox and the plugin used below both need Python 3.11 or later, so `setup-python` also installs Python 3.13, and tox runs on that. tox is installed unpinned, so that the workflow tests the configuration with the tox and virtualenv that a contributor would get. The job has only `contents: read` and uses no secrets. For running tox on GitHub Actions, there are two tox plugins and one action: - `tox-gh`, from the `tox-dev` organization that maintains tox, selects the environments for the job's Python version from a mapping in the tox configuration, puts each environment's output in its own log group, and summarizes the results. - `tox-gh-actions`, an older plugin maintained outside `tox-dev`, does the same with more ways to select environments, and also supports tox 3. This project needs only selection by Python version. - `fedora-python/tox-github-action` runs tox in a Fedora container that has most Python versions, but no longer 3.8. It also pulls its image by a mutable tag, its repository has no license, and it runs tox as root in the container, which would change what GitPython's tests see about file ownership and `safe.directory`. Use `tox-gh`. Selecting environments by version is simple here, but the log groups make long weekly logs easier to read, and it adds little risk, since it comes from the `tox-dev` organization, like tox itself. Its mapping goes in `[tool.tox.gh.python]` in `pyproject.toml`. tox-gh does nothing outside GitHub Actions, and without it, `tox config` only adds a note that `gh` is unused. The job sets `TOX_GH_MAJOR_MINOR` to the matrix version, as tox-gh documents for when tox runs on a different Python. `actionlint`, `zizmor` 1.31.1 (pedantic, with online audits), and `pinact run --check --verify-comment` report nothing for the new workflow, and all pre-commit hooks pass. With `GITHUB_ACTIONS=true` set locally, tox with tox-gh ran only `py38` for `TOX_GH_MAJOR_MINOR=3.8`, in its own log group, and set up `py313`, `ruff`, `format`, `mypy`, `html`, and `misc` for 3.13. The workflow itself has not run on GitHub yet, because `workflow_dispatch` and `schedule` only work once it is on the default branch. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR has two related changes. The first is to move the
[doc]optional dependency to a dependency group (PEP 735). This requires pip v25.1 available for Python 3.9 or later to work; older Python versions will ignore this data. The contents ofdoc/requirements.txtis moved topyproject.toml, and.readthedocs.yamlis adjusted to use the dependency group.The second change is to resolve an incompatibility with the project dependencies identified with uv sync:
The fix is to simply to limit the version via
sphinx >=7.4.7,<8 ; python_version >= "3.9"'. This change should be fine, since versions before Python 3.9 can't install the dependency group and are not tested to build the documentation in the CI.A CI check is added to see if the dependencies can be resolved for all extras and all groups for all supported versions of Python.