Build from git#4961
Open
jvulgan wants to merge 2 commits into
Open
Conversation
Add optional sdist_url field to onboarded_packages JSON schema so packages can be built from arbitrary git sources instead of PyPI sdists. When present, identify-packages outputs PEP 440 URL requirements (e.g. "pkg @ git+url@version") that fromager already supports. Also fixes word-splitting in the build_extra loop and hardens dedup grep with -F for literal matching. Assisted-by: Claude Opus 4.6 <noreply@anthropic.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds support for building onboarded packages directly from git-sourced sdists by extending the package metadata schema and updating identify-packages to emit PEP 440 URL requirements, and onboards the griffe package using this mechanism. Flow diagram for git-sourced sdist handling in identify-packagesflowchart LR
A[onboarded_packages JSON
fields: name, version, ignored_versions, build_extra, sdist_url] --> B[identify-packages]
B --> C{sdist_url present?}
C -- Yes --> D[Emit PEP 440 URL requirement
pkg @ sdist_url@version]
C -- No --> E[Emit standard requirement
pkg==version]
D --> F[Build pipeline
fetch from git URL]
E --> F
G[griffe.json
uses sdist_url git URL] --> B
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The description of
sdist_urlin CLAUDE.md could briefly clarify how the@versionportion of the generated PEP 440 requirement is derived (e.g., tag vs. commit hash) and what happens if the git URL already contains a ref. - In
identify-packages, consider validatingsdist_urlvalues more strictly (e.g., ensure they are git URLs and produce clear errors for malformed inputs) before constructing the PEP 440 URL requirement. - It may be helpful for future maintainers if
identify-packageslogs or annotates when a package is being resolved fromsdist_urlrather than PyPI, so the source of truth is obvious during debugging.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The description of `sdist_url` in CLAUDE.md could briefly clarify how the `@version` portion of the generated PEP 440 requirement is derived (e.g., tag vs. commit hash) and what happens if the git URL already contains a ref.
- In `identify-packages`, consider validating `sdist_url` values more strictly (e.g., ensure they are git URLs and produce clear errors for malformed inputs) before constructing the PEP 440 URL requirement.
- It may be helpful for future maintainers if `identify-packages` logs or annotates when a package is being resolved from `sdist_url` rather than PyPI, so the source of truth is obvious during debugging.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Take sdist from git because the one on pypi has dangling symlink which results in errors like: [Errno 2] No such file or directory: '/var/workdir/output/work-dir/griffe-2.1.0/griffe-2.1.0/docs/logo.svg'
Contributor
Author
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 by Sourcery
Add support for building packages from git-based sdists and document the new configuration field.
New Features:
Documentation: