Repository navigation
Use upstream gix without vendoring and expose Python fixture tools - #2
Merged
Merged
Conversation
Gitoxide merged the Python binding prerequisites in PR #3054. Pin `gix` and `gix-archive` to public `main` at `09f85be4e3fda42f3e8fd19c53a63758fdf6fb3d` so packaged builds use the upstream per-client TLS configuration, raw reflog writes, and literal submodule names directly. The latest crates.io release, `gix 0.89.0`, still lacks all three changes; a registry-only build fails on the absent `configure_client` field, so a published-version migration must wait. Remove the three vendored crates, Cargo patches, sdist inclusion, and patch-specific build/archive handling. Retain the local checkout selector and its separate lockfile; update packaged provenance and coverage docs. Use the new native default worktree-removal retry delay while preserving the Python constructor, and document the unexposed setting. Port the missing Markdown, motivation, scoping, breaking-change, and self-contained commit rules from Gitoxide into `agents.md`. Validation on Apple Silicon macOS with Rust 1.99.0: - Packaged and local CPython 3.14.7: 105 integration tests each, two skips. - Packaged free-threaded 3.14.7 with `PYTHON_GIL=0`: 105 tests, one skip. - SHA-1-only and SHA-256-only: 105 discovered tests each, 75 expected skips. - Default and reduced clippy with warnings denied; seven Rust tests, nine helper checks, Rust formatting, and `git diff --check` pass. - An ABI3 wheel rebuilt from the sdist passes 105 tests on CPython 3.12.14 with two skips. Content and provenance checks pass; the archive has no vendored sources, patches, developer paths, local locks, or binaries. - Project builds use disabled C/C++ compilers. All 60 Gitoxide crates resolve locally when selected; unrelated registry dependencies remain unchanged and dependency metadata fits Rust 1.89. No upstream edits, pushes, publication, remote CI, Intel/cross-platform builds, or actual Rust 1.89 execution. Preserve the existing release tag.
Python test suites need reusable read-only fixtures and a way to initialize or post-process them with ordinary closures. Bind the pinned `gix-testtools` fixture APIs through `gix.testtools` so Python callers share the native cache, versioning, archive, and creation-mode behavior instead of rebuilding it in Python. Pass `FixtureState` to Python producers and post-processors, preserve their return values and original exceptions, and detach during native work. Expose owned writable `TempDir` fixtures with context-manager cleanup, fixture input helpers, and the isolated native `git()` test oracle. Freeze the native tempfile registry without termination handlers before helpers request setup, preserving Python signal ownership. Forward hash features without enabling C-backed XZ support. Update the local checkout selector for `tests/tools`, ship type stubs, and document cache mutation rules, copy-mode limitations, callback reentrancy, and the supported API subset. Keep tests in disposable process workspaces. Validation on Apple Silicon macOS with Rust/Cargo 1.99.0: - Ordinary CPython 3.14.7: 110 discovered tests pass with two expected skips. - Free-threaded 3.14.7 with `PYTHON_GIL=0`: 110 tests, one expected skip. - SHA-1-only and SHA-256-only: 110 tests each, 75 expected skips. - Default and reduced clippy with warnings denied; seven Rust tests, nine helper checks, formatting, and `git diff --check` pass. - An ABI3 wheel rebuilt from its sdist passes all 110 discovered tests in an offline installation; artifact contents and fixture stubs are checked. - Local metadata resolves `gix-testtools` from the selected checkout. Project builds disable C/C++ compilers; dependency metadata fits Rust 1.89. - Final focused fixture and runtime/stub checks pass. No Intel/cross-platform builds, actual Rust 1.89 execution, or publication were performed. Read-only fixture paths remain a caller contract.
Sebastian Thiel (Byron)
marked this pull request as ready for review
October 12, 2026 13:43
Member
Author
|
I don't really review this for now, what matters is that it works for GitPython. More care is probably in order at some point. |
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.
Tasks
refackiewrubber-stampCreated by Codex on behalf of Byron. Byron will review before this is ready to merge.
Summary
Use the public Gitoxide
mainrevision containing the Python binding prerequisites and remove all three vendored crates and their packaging/build patches. Keep reproducible packaged builds and the optional local checkout selector.Expose native cached read-only and writable fixtures through
gix.testtools. Python closures can create fixtures or post-process scripted fixtures, receive native fixture state, and return values for the test suite. Include type stubs, fixture documentation, and isolated integration checks.Context
The latest published
gix 0.89.0still lacks per-client TLS configuration, raw reflog writes, and literal submodule names. The user corrected the initial published-version request to usemain; the dependencies now pin09f85be4e3fda42f3e8fd19c53a63758fdf6fb3d, which includes upstream PR #3054. A crates.io-only migration waits for a compatible release. Worktree removal uses the new native default retry delay, and Gitoxide's missing commit-message rules are recorded inagents.md.The fixture bindings use
gix-testtoolsfrom the same revision and retain its cache/version/archive behavior. Python callback return values and original exceptions are preserved. Native work runs detached from Python; callbacks attach only during invocation, and native termination handlers are disabled before fixture setup. Writable fixtures own their temporary directories and support explicit/context-manager cleanup. The isolated native Git helper is exposed as a test oracle.Both hash configurations, stable-ABI and free-threaded builds, and the no-C/C++ dependency requirement remain supported. Local selection resolves
gix-testtoolsfromtests/tools. Read-only fixtures are a caller contract; native copy mode loses symlinks, and callbacks must not recursively acquire the same fixture. These limits and the unexposed utility subset are documented indocs/testtools.md.Validation
On Apple Silicon macOS with Rust/Cargo 1.99.0:
PYTHON_GIL=0: 110 tests with one skip.sha1,sha256,revision,index) with-D warnings, seven Rust unit tests, nine build/release/justfile helper checks, Rust formatting, andgit diff --checkpass.tests/tools. Project builds use disabled C/C++ compilers; dependency metadata fits Rust 1.89.No Intel/cross-platform builds or actual Rust 1.89 execution were performed. No package publication or upstream Gitoxide edits were made. The full validation record is in
docs/validation.md.User Prompts