Add fallback version for builds without git#1003
Conversation
Building from a release tarball (no .git) fails with "This does not appear to be a Git project". Set a fallback-version so uv-dynamic-versioning resolves a version when git is unavailable; packagers patch it at build time. Closes #1001
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 534e805823
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| vcs = "git" | ||
| style = "pep440" | ||
| bump = true | ||
| fallback-version = "0.0.0" |
There was a problem hiding this comment.
Raise the plugin lower bound with fallback-version
This fallback only works with uv-dynamic-versioning versions that know the fallback-version option; the existing build-system.requires in this package still allows uv-dynamic-versioning>=0.7.0, and 0.7.0's config schema has no fallback_version field, so constrained/offline no-git builds can legally resolve 0.7.x, ignore this new key, and continue failing with the same VCS error. Please bump the build requirement in both package pyprojects to at least the first version that supports fallback-version (0.8.0) when adding this setting.
Useful? React with 👍 / 👎.
Building
httpx2/httpcore2from a release tarball (which has no.git) fails becauseuv-dynamic-versioningqueries git for the version:Set
fallback-versionin both packages souv-dynamic-versioningresolves a version when git is unavailable. Packagers resolve the real version outside the sandbox and patch this value at build time, per the upstream tip.Closes #1001
AI Disclaimer
This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.
Summary by cubic
Add
fallback-version("0.0.0") tohttpx2andhttpcore2souv-dynamic-versioningcan resolve a version without.git, enabling builds from release tarballs. This prevents the "This does not appear to be a Git project" error and lets packagers patch the real version at build time.Written for commit 534e805. Summary will update on new commits.