From 7d4a82d199cb0f5a334f2ab71b36f06071fdfb23 Mon Sep 17 00:00:00 2001 From: "njzjz-bot[bot]" <48687836+njzjz-bot@users.noreply.github.com> Date: Fri, 12 Apr 2024 21:30:18 -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 diff --git a/.git_archival.txt b/.git_archival.txt new file mode 100644 index 0000000000..8fb235d704 --- /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 82d852900b..776405a339 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ # do not show up detailed difference on GitHub source/3rdparty/* linguist-generated=true source/3rdparty/README.md linguist-generated=false +.git_archival.txt export-subst