Add git/path source support for wheel building#13
Merged
Conversation
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>
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.
Summary
sourcefield toRenameSpecfor building wheels from git URLs or local paths instead of downloading from PyPIbuild.pymodule wrapsuv pip wheel --no-depsfor git/path sources--sourceoption onthird-wheel addfor declarative git source renameszarr_devfrom git main vszarr_v2from PyPI)Example usage
Test plan
build_wheel_from_source(mocked subprocess)RenameSpec.source_typepropertysourcefieldadd_rename_to_pyproject/add_rename_to_scriptwith source--sourceflag onaddcommand🤖 Generated with Claude Code