Skip to content

Add fallback version for builds without git#1003

Merged
Kludex merged 2 commits into
mainfrom
add-fallback-version
Jun 1, 2026
Merged

Add fallback version for builds without git#1003
Kludex merged 2 commits into
mainfrom
add-fallback-version

Conversation

@Kludex

@Kludex Kludex commented Jun 1, 2026

Copy link
Copy Markdown
Member

Building httpx2/httpcore2 from a release tarball (which has no .git) fails because uv-dynamic-versioning queries git for the version:

RuntimeError: Error getting the version from source `uv-dynamic-versioning`: This does not appear to be a Git project

Set fallback-version in both packages so uv-dynamic-versioning resolves 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") to httpx2 and httpcore2 so uv-dynamic-versioning can 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.

Review in cubic

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
@Kludex
Kludex enabled auto-merge (squash) June 1, 2026 11:35
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

@codspeed-hq

codspeed-hq Bot commented Jun 1, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 15 untouched benchmarks
⏩ 7 skipped benchmarks1


Comparing add-fallback-version (73fa6ec) with main (8027999)

Open in CodSpeed

Footnotes

  1. 7 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@Kludex
Kludex merged commit 425f23b into main Jun 1, 2026
15 checks passed
@Kludex
Kludex deleted the add-fallback-version branch June 1, 2026 11:36

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/httpx2/pyproject.toml
vcs = "git"
style = "pep440"
bump = true
fallback-version = "0.0.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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.

httpx2 doesn't build from release tarball

1 participant