Skip to content

Commit

Permalink
chore(packaging): Enable support for versioning Git archives (#737)
Browse files Browse the repository at this point in the history
It essentially allows one to
```
$ pip install https://github.com/antonbabenko/pre-commit-terraform/archive/a7155a7.tar.gz
```
and get a correctly computed version in the installed metadata.

[1]: https://setuptools-scm.rtfd.io/en/latest/usage/#git-archives
  • Loading branch information
webknjaz authored Jan 15, 2025
1 parent e01b4de commit a98f23c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true)$
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git_archival.txt export-subst
4 changes: 3 additions & 1 deletion hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ packages = [
]

[metadata.hooks.vcs.urls]
'Source Archive' = 'https://github.com/antonbabenko/pre-commit-terraform/archive/{commit_hash}.tar.gz'
# FIXME: Uncomment 'Source Archive' as soon as
# FIXME: https://github.com/ofek/hatch-vcs/issues/80 is fixed.
# 'Source Archive' = 'https://github.com/antonbabenko/pre-commit-terraform/archive/{commit_hash}.tar.gz'
'GitHub: repo' = 'https://github.com/antonbabenko/pre-commit-terraform'

[version]
Expand Down

0 comments on commit a98f23c

Please sign in to comment.