From 87dfdf335a4ce87310792007efd00d8e308ebe72 Mon Sep 17 00:00:00 2001 From: "A bot of @njzjz" <48687836+njzjz-bot@users.noreply.github.com> Date: Sat, 13 Apr 2024 19:59:31 -0400 Subject: [PATCH] feat(build): Add Git archives version files (#3669) 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. (cherry picked from commit 3eb3d51e27a2853b68fc89dbc555947584a70a8d) Signed-off-by: Jinzhe Zeng --- .git_archival.txt | 4 ++++ .gitattributes | 2 ++ 2 files changed, 6 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 e77d446ba6..776405a339 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +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