Skip to content

Use upstream gix without vendoring and expose Python fixture tools - #2

Merged
Sebastian Thiel (Byron) merged 2 commits into
mainfrom
re-integrate
Oct 12, 2026
Merged

Sebastian Thiel (Byron) merged 2 commits into
mainfrom
re-integrate

Conversation

@Byron

@Byron Byron commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Tasks

  • refackiew rubber-stamp

Created by Codex on behalf of Byron. Byron will review before this is ready to merge.

Summary

Use the public Gitoxide main revision 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.0 still lacks per-client TLS configuration, raw reflog writes, and literal submodule names. The user corrected the initial published-version request to use main; the dependencies now pin 09f85be4e3fda42f3e8fd19c53a63758fdf6fb3d, 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 in agents.md.

The fixture bindings use gix-testtools from 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-testtools from tests/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 in docs/testtools.md.

Validation

On Apple Silicon macOS with Rust/Cargo 1.99.0:

  • Packaged CPython 3.14.7: 110 discovered tests pass with two expected skips; free-threaded 3.14.7 with PYTHON_GIL=0: 110 tests with one skip.
  • SHA-1-only and SHA-256-only builds: 110 discovered tests each, 75 expected capability skips.
  • Default and reduced clippy (sha1,sha256,revision,index) with -D warnings, seven Rust unit tests, nine build/release/justfile helper checks, Rust formatting, and git diff --check pass.
  • An ABI3 wheel rebuilt from the sdist passes 110 discovered tests in an offline installation. Archive/wheel contents and provenance checks pass; no vendored sources or machine-specific dependency paths remain.
  • Fixture tests cover concurrent initialization, cross-process cache reuse, TAR extraction, Python post-processing variants, isolated Git environment, cleanup, exception identity/retry, invalid inputs, and Python signal ownership. Final focused fixture and typing checks pass.
  • Local metadata resolves the selected checkout, including 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

Re-integrate the latest published version of gix which contains everything that was vendored before, and consider removing the vendoring now that it permanently shouldn't be needed anymore.
Create a descriptive commit for that, and follow the gix rules on comitting. If they aren't yet in agents.md, port them over from /Users/byron/dev/github.com/GitoxideLabs/gitoxide .

Right, it's actually only in main. Then try to use the version from main instead, if needed, just update the vendoring.

Make sure that gix-testtools are also available in GixPython, to allow test-suites to be built around read-only fixtures where applicable.
Make it so that the Rust-based post-processing can run in Python, so a simple python closure can post-process fixtures.

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.
@Byron
Sebastian Thiel (Byron) marked this pull request as ready for review October 12, 2026 13:43
@Byron

Byron commented Oct 12, 2026

Copy link
Copy Markdown
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.

@Byron
Sebastian Thiel (Byron) merged commit 3d55a86 into main Oct 12, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants