From a98f23c91cd005b7f45c86728c697d4f82774958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=87=BA=F0=9F=87=A6=20Sviatoslav=20Sydorenko=20=28?= =?UTF-8?q?=D0=A1=D0=B2=D1=8F=D1=82=D0=BE=D1=81=D0=BB=D0=B0=D0=B2=20=D0=A1?= =?UTF-8?q?=D0=B8=D0=B4=D0=BE=D1=80=D0=B5=D0=BD=D0=BA=D0=BE=29?= Date: Wed, 15 Jan 2025 21:57:27 +0100 Subject: [PATCH] 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 --- .git_archival.txt | 3 +++ .gitattributes | 1 + hatch.toml | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .git_archival.txt create mode 100644 .gitattributes diff --git a/.git_archival.txt b/.git_archival.txt new file mode 100644 index 000000000..3e26627d4 --- /dev/null +++ b/.git_archival.txt @@ -0,0 +1,3 @@ +node: $Format:%H$ +node-date: $Format:%cI$ +describe-name: $Format:%(describe:tags=true)$ diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..00a7b00c9 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +.git_archival.txt export-subst diff --git a/hatch.toml b/hatch.toml index 9d3cd73ea..1cb850f63 100644 --- a/hatch.toml +++ b/hatch.toml @@ -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]