From 37623c69a0904c0de316291dfa69cd3bb952e6a6 Mon Sep 17 00:00:00 2001 From: Catherine Date: Thu, 2 Feb 2023 23:28:51 +0000 Subject: [PATCH] Configure git-archive to export information for setuptools_scm. This requires git>=2.32.0. --- .git_archival.txt | 4 ++++ .gitattributes | 1 + setup.py | 4 +--- 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 .git_archival.txt diff --git a/.git_archival.txt b/.git_archival.txt new file mode 100644 index 0000000..8fb235d --- /dev/null +++ b/.git_archival.txt @@ -0,0 +1,4 @@ +node: $Format:%H$ +node-date: $Format:%cI$ +describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$ +ref-names: $Format:%D$ diff --git a/.gitattributes b/.gitattributes index 208af66..5f2f45f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ +.git_archival.txt export-subst /amaranth/vendor/* -linguist-vendored diff --git a/setup.py b/setup.py index 56c67e2..d63e3f7 100644 --- a/setup.py +++ b/setup.py @@ -4,9 +4,7 @@ from setuptools_scm.git import parse as parse_git def doc_version(): git = parse_git(".") - if not git: - return "" - elif git.exact: + if git.exact: return git.format_with("v{tag}") else: return "latest"