Skip to content

Add git/path source support for wheel building#13

Merged
ianhi merged 3 commits intomainfrom
feat/git-source-renames
Mar 11, 2026
Merged

Add git/path source support for wheel building#13
ianhi merged 3 commits intomainfrom
feat/git-source-renames

Conversation

@ianhi
Copy link
Copy Markdown
Collaborator

@ianhi ianhi commented Mar 11, 2026

Summary

  • Add source field to RenameSpec for building wheels from git URLs or local paths instead of downloading from PyPI
  • New build.py module wraps uv pip wheel --no-deps for git/path sources
  • --source option on third-wheel add for declarative git source renames
  • Git sources are cached; path sources always rebuild (mutable)
  • 26 new tests (unit, CLI, property-based), all 321 tests pass
  • Updated zarr example to demo git source (zarr_dev from git main vs zarr_v2 from PyPI)

Example usage

[tool.third-wheel]
renames = [
    {original = "zarr", new-name = "zarr_dev", source = "git+https://github.com/zarr-developers/zarr-python@main"},
]
third-wheel add "zarr=zarr_dev" --source "git+https://github.com/zarr-developers/zarr-python@main"

Test plan

  • Unit tests for build_wheel_from_source (mocked subprocess)
  • Tests for RenameSpec.source_type property
  • Tests for TOML parsing with source field
  • Tests for add_rename_to_pyproject / add_rename_to_script with source
  • Property tests for source field in RenameSpec strategies
  • CLI tests for --source flag on add command
  • All 321 tests pass, lint clean

🤖 Generated with Claude Code

ianhi and others added 3 commits March 11, 2026 13:18
Support building renamed wheels from git URLs or local paths instead of
only downloading from PyPI. Adds `source` field to RenameSpec and
`build.py` module using `uv pip wheel --no-deps`. Git sources are
cached; path sources always rebuild.

- Add `build_wheel_from_source()` in new `build.py` module
- Add `source` field to `RenameSpec`, `source_type` property
- Add `--source` option to `third-wheel add` CLI command
- Update `prepare_wheels()` to branch on source type
- Update `sync` to skip cache for mutable path sources
- Add 26 new tests (unit, CLI, property-based)
- Update zarr example to use git source for dev version
- Update README and architecture docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… --patch-strings

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When renaming a wheel, packages that reference their own module paths
as strings (plugin registries, config defaults, importlib calls) break
because the strings still point to the old name. This adds a
patch_strings mode that also rewrites word-boundary occurrences of the
old module name in Python source files (while still skipping file
extensions like .zarr).

- On by default for `run` and `sync` (via prepare_wheels)
- Off by default for low-level `rename` command (opt-in with --patch-strings)
- Reuses the regex from patch.py (_update_dependency_references)
- 2 new tests verifying string rewriting behavior

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@ianhi ianhi merged commit 402ddf4 into main Mar 11, 2026
2 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.

1 participant