-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hatch-vcs metadata hook fails when run on sdist tarball #36
Comments
workaround for ofek/hatch-vcs#36
Had a closer look at this and was thinking hatch-vcs could read a fallback So something like this (pseudo-code): def get_commit_hash(self):
try:
commit_hash = vcs_utils.get_commit_hash(self.root)
store_commit_hash(commit_hash, fallback_file)
except:
commit_hash = read_commit_hash(fallback_file)
# How it's used:
'commit_hash': lambda *args: get_commit_hash(), In this scenario, the question becomes what the location and format of
Any thoughts? |
Metadata is now persisted for dynamic fields properly as of Hatchling v1.22.0 |
When using the metadata hook and doing a
hatch build -t wheel
build from an sdist tarball that was previously built using hatch-vcs, the metadata hook will attempt to access version control to determine thecommit_hash
variable:hatch-vcs/hatch_vcs/metadata_hook.py
Line 39 in 0c9289d
This will cause hatch-vcs to crash since there’s no version control present in the sdist tarball.
Details on how to reproduce for my project gitlint: jorisroovers/gitlint#460
Discussed with @ofek in jorisroovers/gitlint#367
The text was updated successfully, but these errors were encountered: