Skip to content

Commit

Permalink
feat(build): Add Git archives version files
Browse files Browse the repository at this point in the history
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: njzjz-bot/njzjz-bot#4.
  • Loading branch information
njzjz-bot committed Apr 13, 2024
1 parent 7594b8d commit 7a81b32
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.H linguist-language=C++
*.C linguist-language=C++
.git_archival.txt export-subst
20 changes: 10 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = [
"setuptools",
"setuptools_scm",
"wheel",
"scikit-build",
"cmake",
# see https://github.com/scikit-build/scikit-build/releases/tag/0.13.1
"ninja; platform_system!='Windows'",
]
[build-system]
requires = [
"setuptools",
"setuptools_scm",
"wheel",
"scikit-build",
"cmake",
# see https://github.com/scikit-build/scikit-build/releases/tag/0.13.1
"ninja; platform_system!='Windows'",
]

0 comments on commit 7a81b32

Please sign in to comment.