Skip to content

build: add fallback version for builds without git metadata#120

Open
Qbushey wants to merge 1 commit into
caelestia-dots:mainfrom
Qbushey:build-fallback-version
Open

build: add fallback version for builds without git metadata#120
Qbushey wants to merge 1 commit into
caelestia-dots:mainfrom
Qbushey:build-fallback-version

Conversation

@Qbushey

@Qbushey Qbushey commented Jun 11, 2026

Copy link
Copy Markdown

Fixes #81

When the source tree has no git metadata (release tarballs, some AUR helper build setups), hatch-vcs cannot determine a version and the build backend aborts, so python -m build --wheel produces no dist/ directory and the subsequent python -m installer dist/*.whl fails with FileNotFoundError This is exactly the paru log in the issue.

This adds setuptools-scm's fallback_version via [tool.hatch.version.raw-options], so such builds succeed with version 0.0.0 instead of failing.

Verified by building the same tree with and without .git: without this change the no-git build errors out (ERROR Backend subprocess exited when trying to invoke build_wheel); with it, caelestia-0.0.0-py3-none-any.whl is produced. Builds from a proper git checkout are unaffected and keep their hatch-vcs derived version (the nix build is also unaffected as it sets SETUPTOOLS_SCM_PRETEND_VERSION).

hatch-vcs fails the build when the source tree has no git metadata
(release tarballs, some AUR helper build dirs), which made
'python -m build --wheel' produce no dist/ output.

Fixes caelestia-dots#81
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.

[BUG] Build fails when using build --wheel

1 participant