Skip to content

Commit 3e022ad

Browse files
authored
[REL] Add git archival support for setuptools-scm (#1609)
* Add git archival support * Add a comment about export-subst
1 parent 03b613b commit 3e022ad

File tree

7 files changed

+14
-3
lines changed

7 files changed

+14
-3
lines changed

.git_archival.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node: $Format:%H$
2+
node-date: $Format:%cI$
3+
ref-names: $Format:%D$

.gitattributes

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cuda/_version.py export-subst
2-
31
* text eol=lf
42
*.cmd text eol=crlf
53

@@ -16,3 +14,9 @@ cuda_core/cuda/core/_cpp/*.hpp -binary text diff
1614
*.svg binary
1715
# SCM syntax highlighting & preventing 3-way merges
1816
pixi.lock merge=binary linguist-language=YAML linguist-generated=true
17+
18+
# "export-subst" specifies that this file will get filled in with the current
19+
# commit and tag information when running `git archive`. This allows
20+
# `setuptools-scm` to correctly determine the version when building from a git
21+
# archive. See #1609.
22+
.git_archival.txt export-subst

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ repos:
2929
language: python
3030
additional_dependencies:
3131
- https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl
32-
exclude: '.*pixi\.lock'
32+
exclude: '(.*pixi\.lock)|(\.git_archival\.txt)'
3333
args: ["--fix"]
3434

3535
- id: no-markdown-in-docs-source

cuda_bindings/.git_archival.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.git_archival.txt

cuda_core/.git_archival.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.git_archival.txt

cuda_pathfinder/.git_archival.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.git_archival.txt
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.git_archival.txt

0 commit comments

Comments
 (0)