From d7f15a6ea7e688544868a11063ab0340287f8c75 Mon Sep 17 00:00:00 2001 From: "njzjz-bot[bot]" <48687836+njzjz-bot@users.noreply.github.com> Date: Fri, 12 Apr 2024 21:39:00 -0400 Subject: [PATCH] feat(build): Add Git archives version files When downloading the source code of a branch or a release from GitHub or the mirror, there is no Git version information, making setuptools-scm unable to read the version. The alternative way is to add a git archive file supported by setuptools-scm. See: * https://setuptools-scm.readthedocs.io/en/latest/usage/#git-archives (available in setuptools-scm 7.0.0) * https://git-scm.com/docs/git-archive#Documentation/git-archive.txt-export-subst * https://docs.github.com/en/repositories/working-with-files/using-files/downloading-source-code-archives Generated by the task: https://github.com/njzjz-bot/njzjz-bot/issues/4. --- .git_archival.txt | 4 ++++ .gitattributes | 1 + 2 files changed, 5 insertions(+) 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..8fb235d70 --- /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 new file mode 100644 index 000000000..00a7b00c9 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +.git_archival.txt export-subst