Skip to content

Commit c14f938

Browse files
committed
ci: define package roots and enforce per-line SCM metadata
Review-only narrative layer 2 of 6 for #2737. Define the schema-2 package-root registry, shared configuration and SCM helpers, standalone metapackage metadata, and their regression coverage. Enforce maintenance/current selector rules, exclude the old CUDA 12.9.0 baseline, reject current-root fallbacks, and stop the maintenance override when an eligible Git tag is reachable. Include Core bindings-floor validation and its PyYAML test dependency. Unsupported historical layouts fail explicitly; no compatibility resolver is retained. Implementation source: 6c3de41 Review baseline: ab9e20f Read these commits in order. Shared files are assigned as complete files to one layer, so intermediate commits need not build or pass CI. Only the final Git tree matches the implementation. This branch is a reading aid, not an alternate merge or release path. Validation belongs to the implementation source above.
1 parent 1393310 commit c14f938

22 files changed

Lines changed: 1582 additions & 103 deletions

‎.pre-commit-config.yaml‎

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ repos:
2828
hooks:
2929
- id: ruff-check
3030
args: [--fix, --show-fixes]
31-
exclude: (^cuda_bindings/cuda/bindings/_internal/_fast_enum\.py$)|(.*\.pyi$)
31+
exclude: (^cuda_bindings(?:_[^/]+)?/cuda/bindings/_internal/_fast_enum\.py$)|(.*\.pyi$)
3232
- id: ruff-format
3333
exclude: .*\.pyi$
3434

@@ -50,6 +50,7 @@ repos:
5050
pass_filenames: false
5151
additional_dependencies:
5252
- "tomli>=1.1.0; python_version < '3.11'"
53+
- PyYAML==6.0.3
5354

5455
- id: check-spdx
5556
name: Check SPDX Headers
@@ -64,15 +65,23 @@ repos:
6465
name: Check generated-file seals
6566
entry: python ./toolshed/check_generated_file_seals.py
6667
language: python
67-
files: ^cuda_bindings/
68+
files: ^cuda_bindings(?:_[^/]+)?/
6869
types: [text]
6970

71+
- id: check-bindings-config
72+
name: Validate bindings registry and package metadata
73+
entry: python -m ci.tools.bindings_config --check-package-metadata
74+
language: python
75+
additional_dependencies: [packaging==26.0, pyyaml==6.0.3]
76+
files: '^(ci/versions\.yml|cuda_bindings(?:_[^/]+)?/(pyproject|pixi)\.toml|cuda_python/setup\.py)$'
77+
pass_filenames: false
78+
7079
- id: check-pixi-cuda-version
7180
name: Check pixi cuda-version pins track ci/versions.yml
72-
entry: python ./ci/tools/check_pixi_cuda_version.py
81+
entry: python -m ci.tools.check_pixi_cuda_version
7382
language: python
74-
additional_dependencies: [pyyaml==6.0.3]
75-
files: '^(ci/versions\.yml|cuda_bindings/pixi\.toml|cuda_core/pixi\.toml)$'
83+
additional_dependencies: [packaging==26.0, pyyaml==6.0.3]
84+
files: '^(ci/versions\.yml|cuda_bindings(?:_[^/]+)?/pixi\.toml|cuda_core/pixi\.toml)$'
7685
pass_filenames: false
7786

7887
- id: check-mempool-hygiene
@@ -85,7 +94,7 @@ repos:
8594
name: Check shared build_hooks.py blocks are in sync
8695
entry: python ./toolshed/check_build_hooks_sync.py
8796
language: python
88-
files: '^(cuda_bindings|cuda_core)/build_hooks\.py$'
97+
files: '^(cuda_bindings(?:_[^/]+)?|cuda_core)/build_hooks\.py$'
8998
pass_filenames: false
9099

91100
- id: no-markdown-in-docs-source
@@ -96,6 +105,9 @@ repos:
96105
- "_" # fake script name, because bash considers $0 (the first argument) to be the script name
97106
language: system
98107
files: '^.*/docs/source/.*\.md$'
108+
# The imported CUDA 12.9 documentation retains its historical MyST
109+
# sources; new documentation elsewhere must continue to use reST.
110+
exclude: '^cuda_bindings_12/docs/source/'
99111

100112
- id: stubgen-pyx-cuda-core
101113
name: Generate .pyi stubs for cuda_core
@@ -126,7 +138,7 @@ repos:
126138
rev: "3e8a8703264a2f4a69428a0aa4dcb512790b2c8c" # frozen: v6.0.0
127139
hooks:
128140
- id: check-added-large-files
129-
exclude: cuda_bindings/cuda/bindings/nvml.pyx
141+
exclude: '^(?:cuda_bindings(?:_[^/]+)?/(?:cuda/bindings/(?:driver\.pyx|runtime\.pyx\.in|nvml\.pyx)|pixi\.lock))$'
130142
- id: check-case-conflict
131143
- id: check-docstring-first
132144
- id: check-merge-conflict
@@ -135,14 +147,14 @@ repos:
135147
- id: check-yaml
136148
- id: debug-statements
137149
- id: end-of-file-fixer
138-
exclude: &gen_exclude '^(?:cuda_python/README\.md|(?:.*/)?CLAUDE\.md|(?:.*/)?\.git_archival\.txt|cuda_bindings/cuda/bindings/.*\.in?|cuda_bindings/docs/source/module/.*\.rst?|.*\.pyi)$'
150+
exclude: &gen_exclude '^(?:cuda_python/README\.md|(?:.*/)?CLAUDE\.md|(?:.*/)?\.git_archival\.txt|cuda_bindings(?:_[^/]+)?/cuda/bindings/.*\.in?|cuda_bindings(?:_[^/]+)?/docs/source/module/.*\.rst?|.*\.pyi)$'
139151
- id: mixed-line-ending
140152
- id: trailing-whitespace
141153
exclude: |
142154
(?x)^(?:
143155
cuda_python/README\.md|
144-
cuda_bindings/cuda/bindings/.*\.in?|
145-
cuda_bindings/docs/source/module/.*\.rst?|
156+
cuda_bindings(?:_[^/]+)?/cuda/bindings/.*\.in?|
157+
cuda_bindings(?:_[^/]+)?/docs/source/module/.*\.rst?|
146158
.*\.patch$
147159
)$
148160
@@ -184,7 +196,7 @@ repos:
184196
hooks:
185197
- id: cython-lint
186198
args: [--no-pycodestyle]
187-
exclude: ^cuda_bindings/
199+
exclude: ^cuda_bindings(?:_[^/]+)?/
188200
additional_dependencies:
189201
- Cython==3.2.9
190202

‎ci/__init__.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
"""CUDA Python continuous-integration support."""

‎ci/pyproject.toml‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
[build-system]
5+
requires = ["setuptools>=77.0.0"]
6+
build-backend = "setuptools.build_meta"
7+
8+
[project]
9+
name = "cuda-python-ci-tools"
10+
version = "0.0.0"
11+
description = "Private CI support for the CUDA Python repository"
12+
authors = [{ name = "NVIDIA Corporation" }]
13+
license = "Apache-2.0"
14+
requires-python = ">=3.11"
15+
dependencies = [
16+
"packaging==26.0",
17+
"PyYAML==6.0.3",
18+
]
19+
20+
[project.optional-dependencies]
21+
test = ["pytest==9.1.0", "setuptools-scm>=8,!=10.1", "wheel"]
22+
23+
[tool.setuptools]
24+
packages = ["ci", "ci.tools"]
25+
package-dir = { ci = "." }

‎ci/tools/__init__.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
"""Shared CI tools used by workflows and local validation."""

0 commit comments

Comments
 (0)