Skip to content

Commit a98f23c

Browse files
authored
chore(packaging): Enable support for versioning Git archives (#737)
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
1 parent e01b4de commit a98f23c

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.git_archival.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node: $Format:%H$
2+
node-date: $Format:%cI$
3+
describe-name: $Format:%(describe:tags=true)$

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.git_archival.txt export-subst

hatch.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ packages = [
1414
]
1515

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

2022
[version]

0 commit comments

Comments
 (0)