From f9aaccae4cc836a3019364586a2430d750a8a309 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 12 Feb 2026 09:37:42 -0500 Subject: [PATCH 1/2] Add git archival support --- .git_archival.txt | 3 +++ .gitattributes | 4 ++-- .pre-commit-config.yaml | 2 +- cuda_bindings/.git_archival.txt | 1 + cuda_core/.git_archival.txt | 1 + cuda_pathfinder/.git_archival.txt | 1 + cuda_python_test_helpers/.git_archival.txt | 1 + 7 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .git_archival.txt create mode 120000 cuda_bindings/.git_archival.txt create mode 120000 cuda_core/.git_archival.txt create mode 120000 cuda_pathfinder/.git_archival.txt create mode 120000 cuda_python_test_helpers/.git_archival.txt diff --git a/.git_archival.txt b/.git_archival.txt new file mode 100644 index 0000000000..b651b9d07d --- /dev/null +++ b/.git_archival.txt @@ -0,0 +1,3 @@ +node: $Format:%H$ +node-date: $Format:%cI$ +ref-names: $Format:%D$ diff --git a/.gitattributes b/.gitattributes index f713b27424..38c6599c71 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,3 @@ -cuda/_version.py export-subst - * text eol=lf *.cmd text eol=crlf @@ -16,3 +14,5 @@ cuda_core/cuda/core/_cpp/*.hpp -binary text diff *.svg binary # SCM syntax highlighting & preventing 3-way merges pixi.lock merge=binary linguist-language=YAML linguist-generated=true + +.git_archival.txt export-subst diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1c4339b948..44ba5d5bf2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: language: python additional_dependencies: - https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl - exclude: '.*pixi\.lock' + exclude: '(.*pixi\.lock)|(\.git_archival\.txt)' args: ["--fix"] - id: no-markdown-in-docs-source diff --git a/cuda_bindings/.git_archival.txt b/cuda_bindings/.git_archival.txt new file mode 120000 index 0000000000..d7a42b253d --- /dev/null +++ b/cuda_bindings/.git_archival.txt @@ -0,0 +1 @@ +../.git_archival.txt \ No newline at end of file diff --git a/cuda_core/.git_archival.txt b/cuda_core/.git_archival.txt new file mode 120000 index 0000000000..d7a42b253d --- /dev/null +++ b/cuda_core/.git_archival.txt @@ -0,0 +1 @@ +../.git_archival.txt \ No newline at end of file diff --git a/cuda_pathfinder/.git_archival.txt b/cuda_pathfinder/.git_archival.txt new file mode 120000 index 0000000000..d7a42b253d --- /dev/null +++ b/cuda_pathfinder/.git_archival.txt @@ -0,0 +1 @@ +../.git_archival.txt \ No newline at end of file diff --git a/cuda_python_test_helpers/.git_archival.txt b/cuda_python_test_helpers/.git_archival.txt new file mode 120000 index 0000000000..d7a42b253d --- /dev/null +++ b/cuda_python_test_helpers/.git_archival.txt @@ -0,0 +1 @@ +../.git_archival.txt \ No newline at end of file From 2fae0fc18f4c81dff018524a04718ab583d00f12 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 12 Feb 2026 15:34:54 -0500 Subject: [PATCH 2/2] Add a comment about export-subst --- .gitattributes | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitattributes b/.gitattributes index 38c6599c71..222c26f0cf 100644 --- a/.gitattributes +++ b/.gitattributes @@ -15,4 +15,8 @@ cuda_core/cuda/core/_cpp/*.hpp -binary text diff # SCM syntax highlighting & preventing 3-way merges pixi.lock merge=binary linguist-language=YAML linguist-generated=true +# "export-subst" specifies that this file will get filled in with the current +# commit and tag information when running `git archive`. This allows +# `setuptools-scm` to correctly determine the version when building from a git +# archive. See #1609. .git_archival.txt export-subst