Skip to content

Commit 78c8b5d

Browse files
authored
Merge branch 'main' into fix/system-event-missing-cdef-attrs
2 parents 1d5d34d + 231100b commit 78c8b5d

39 files changed

Lines changed: 1022 additions & 115 deletions

LICENSE

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,28 @@ Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
176176
of your accepting any such warranty or additional liability.
177177

178178
END OF TERMS AND CONDITIONS
179+
180+
APPENDIX: How to apply the Apache License to your work.
181+
182+
To apply the Apache License to your work, attach the following
183+
boilerplate notice, with the fields enclosed by brackets "[]"
184+
replaced with your own identifying information. (Don't include
185+
the brackets!) The text should be enclosed in the appropriate
186+
comment syntax for the file format. We also recommend that a
187+
file or class name and description of purpose be included on the
188+
same "printed page" as the copyright notice for easier
189+
identification within third-party archives.
190+
191+
Copyright [yyyy] [name of copyright owner]
192+
193+
Licensed under the Apache License, Version 2.0 (the "License");
194+
you may not use this file except in compliance with the License.
195+
You may obtain a copy of the License at
196+
197+
http://www.apache.org/licenses/LICENSE-2.0
198+
199+
Unless required by applicable law or agreed to in writing, software
200+
distributed under the License is distributed on an "AS IS" BASIS,
201+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202+
See the License for the specific language governing permissions and
203+
limitations under the License.

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,14 @@ The list of available interfaces is:
5252

5353
CUDA Python is licensed under the [Apache License 2.0](./LICENSE). Third-party
5454
attributions for `cuda.core` are listed in [`cuda_core/NOTICE`](./cuda_core/NOTICE).
55+
56+
Each subproject is distributed as its own package and ships a copy of the same
57+
license alongside its sources, so that the license accompanies the built wheel.
58+
The root `LICENSE` governs the repository as a whole:
59+
60+
| Subproject | License | License file |
61+
| ---------------- | ---------- | -------------------------------------------------------- |
62+
| `cuda.bindings` | Apache-2.0 | [`cuda_bindings/LICENSE`](./cuda_bindings/LICENSE) |
63+
| `cuda.core` | Apache-2.0 | [`cuda_core/LICENSE`](./cuda_core/LICENSE) |
64+
| `cuda.pathfinder`| Apache-2.0 | [`cuda_pathfinder/LICENSE`](./cuda_pathfinder/LICENSE) |
65+
| `cuda-python` | Apache-2.0 | [`cuda_python/LICENSE`](./cuda_python/LICENSE) |

ci/tools/check_release_notes.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import os
1919
import re
2020
import sys
21+
from pathlib import Path
2122

2223
COMPONENT_TO_PACKAGE: dict[str, str] = {
2324
"cuda-core": "cuda_core",
@@ -62,8 +63,8 @@ def is_post_release(version: str) -> bool:
6263
return ".post" in version
6364

6465

65-
def load_backport_branch(repo_root: str = ".") -> str | None:
66-
path = os.path.join(repo_root, "ci", "versions.yml")
66+
def load_backport_branch(repo_root: Path = Path(".")) -> str | None:
67+
path = repo_root / "ci" / "versions.yml"
6768
try:
6869
with open(path, encoding="utf-8") as f:
6970
for line in f:
@@ -84,13 +85,16 @@ def is_backport_version(version: str, backport_branch: str) -> bool:
8485
return version == backport_branch
8586

8687

87-
def notes_path(package: str, version: str) -> str:
88-
return os.path.join(package, "docs", "source", "release", f"{version}-notes.rst")
88+
def notes_path(package: str, version: str) -> Path:
89+
return Path(package, "docs", "source", "release", f"{version}-notes.rst")
8990

9091

91-
def check_release_notes(git_tag: str, component: str, repo_root: str = ".") -> list[tuple[str, str]]:
92+
def check_release_notes(git_tag: str, component: str, repo_root: Path = Path(".")) -> list[tuple[str | Path, str]]:
9293
"""Return a list of (path, reason) for missing or empty release notes.
9394
95+
``path`` is the repo-relative notes path, or a ``<placeholder>`` naming the
96+
offending argument when the tag or component itself is the problem.
97+
9498
Returns an empty list when notes are present and non-empty, or when the
9599
tag is a .post release (no new notes required).
96100
"""
@@ -105,10 +109,10 @@ def check_release_notes(git_tag: str, component: str, repo_root: str = ".") -> l
105109
return []
106110

107111
path = notes_path(COMPONENT_TO_PACKAGE[component], version)
108-
full = os.path.join(repo_root, path)
109-
if not os.path.isfile(full):
112+
full = repo_root / path
113+
if not full.is_file():
110114
return [(path, "missing")]
111-
if os.path.getsize(full) == 0:
115+
if full.stat().st_size == 0:
112116
return [(path, "empty")]
113117
return []
114118

@@ -123,7 +127,7 @@ def write_step_summary(message: str) -> None:
123127
f.write("\n")
124128

125129

126-
def warn_missing_backport_notes(git_tag: str, component: str, problems: list[tuple[str, str]]) -> None:
130+
def warn_missing_backport_notes(git_tag: str, component: str, problems: list[tuple[str | Path, str]]) -> None:
127131
print(f"WARNING: missing or empty release notes for backport tag {git_tag}:")
128132
summary_lines = [
129133
"## Release Notes Reminder",
@@ -147,8 +151,8 @@ def validate_backport_decision(
147151
version: str,
148152
backport_git_tag: str,
149153
backport_branch: str | None,
150-
repo_root: str,
151-
) -> tuple[int | None, list[tuple[str, str]]]:
154+
repo_root: Path,
155+
) -> tuple[int | None, list[tuple[str | Path, str]]]:
152156
if component not in BACKPORT_PLANNING_COMPONENTS or is_post_release(version):
153157
return None, []
154158

@@ -205,7 +209,7 @@ def main(argv: list[str] | None = None) -> int:
205209
parser = argparse.ArgumentParser(description=__doc__)
206210
parser.add_argument("--git-tag", required=True)
207211
parser.add_argument("--component", required=True, choices=list(COMPONENT_TO_PACKAGE))
208-
parser.add_argument("--repo-root", default=".")
212+
parser.add_argument("--repo-root", default=Path("."), type=Path)
209213
parser.add_argument("--backport-git-tag", default="")
210214
parser.add_argument("--backport-branch", default="")
211215
args = parser.parse_args(argv)

ci/tools/tests/test_check_release_notes.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
from __future__ import annotations
55

6-
import os
76
import sys
7+
from pathlib import Path
88

9-
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
9+
sys.path.insert(0, str(Path(__file__).parent.parent))
1010
from check_release_notes import (
1111
check_release_notes,
1212
is_post_release,
@@ -87,43 +87,43 @@ def _make_notes(self, tmp_path, pkg, version, content="Release notes."):
8787

8888
def test_present_and_nonempty(self, tmp_path):
8989
self._make_notes(tmp_path, "cuda_core", "0.7.0")
90-
problems = check_release_notes("cuda-core-v0.7.0", "cuda-core", str(tmp_path))
90+
problems = check_release_notes("cuda-core-v0.7.0", "cuda-core", tmp_path)
9191
assert problems == []
9292

9393
def test_missing(self, tmp_path):
94-
problems = check_release_notes("cuda-core-v0.7.0", "cuda-core", str(tmp_path))
94+
problems = check_release_notes("cuda-core-v0.7.0", "cuda-core", tmp_path)
9595
assert len(problems) == 1
9696
assert problems[0][1] == "missing"
9797

9898
def test_empty(self, tmp_path):
9999
self._make_notes(tmp_path, "cuda_core", "0.7.0", content="")
100-
problems = check_release_notes("cuda-core-v0.7.0", "cuda-core", str(tmp_path))
100+
problems = check_release_notes("cuda-core-v0.7.0", "cuda-core", tmp_path)
101101
assert len(problems) == 1
102102
assert problems[0][1] == "empty"
103103

104104
def test_post_release_skipped(self, tmp_path):
105-
problems = check_release_notes("v12.6.2.post1", "cuda-bindings", str(tmp_path))
105+
problems = check_release_notes("v12.6.2.post1", "cuda-bindings", tmp_path)
106106
assert problems == []
107107

108108
def test_invalid_tag(self, tmp_path):
109-
problems = check_release_notes("not-a-tag", "cuda-core", str(tmp_path))
109+
problems = check_release_notes("not-a-tag", "cuda-core", tmp_path)
110110
assert len(problems) == 1
111111
assert "cannot parse" in problems[0][1]
112112

113113
def test_component_prefix_mismatch(self, tmp_path):
114114
# Pass a cuda-core tag with component=cuda-pathfinder; must be rejected.
115-
problems = check_release_notes("cuda-core-v0.7.0", "cuda-pathfinder", str(tmp_path))
115+
problems = check_release_notes("cuda-core-v0.7.0", "cuda-pathfinder", tmp_path)
116116
assert len(problems) == 1
117117
assert "cannot parse" in problems[0][1]
118118

119119
def test_unknown_component(self, tmp_path):
120-
problems = check_release_notes("v13.1.0", "bogus", str(tmp_path))
120+
problems = check_release_notes("v13.1.0", "bogus", tmp_path)
121121
assert len(problems) == 1
122122
assert "unknown component" in problems[0][1]
123123

124124
def test_plain_v_tag(self, tmp_path):
125125
self._make_notes(tmp_path, "cuda_python", "13.1.0")
126-
problems = check_release_notes("v13.1.0", "cuda-python", str(tmp_path))
126+
problems = check_release_notes("v13.1.0", "cuda-python", tmp_path)
127127
assert problems == []
128128

129129

@@ -133,17 +133,17 @@ def test_from_versions_yml(self, tmp_path):
133133
d.mkdir(parents=True)
134134
(d / "versions.yml").write_text('backport_branch: "12.9.x"\n')
135135

136-
assert load_backport_branch(str(tmp_path)) == "12.9.x"
136+
assert load_backport_branch(tmp_path) == "12.9.x"
137137

138138
def test_from_github_ref_name_for_legacy_backport_branch(self, tmp_path, monkeypatch):
139139
monkeypatch.setenv("GITHUB_REF_NAME", "12.9.x")
140140

141-
assert load_backport_branch(str(tmp_path)) == "12.9.x"
141+
assert load_backport_branch(tmp_path) == "12.9.x"
142142

143143
def test_ignores_non_backport_github_ref_name(self, tmp_path, monkeypatch):
144144
monkeypatch.setenv("GITHUB_REF_NAME", "main")
145145

146-
assert load_backport_branch(str(tmp_path)) is None
146+
assert load_backport_branch(tmp_path) is None
147147

148148

149149
class TestMain:

cuda_bindings/LICENSE

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,28 @@ Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
176176
of your accepting any such warranty or additional liability.
177177

178178
END OF TERMS AND CONDITIONS
179+
180+
APPENDIX: How to apply the Apache License to your work.
181+
182+
To apply the Apache License to your work, attach the following
183+
boilerplate notice, with the fields enclosed by brackets "[]"
184+
replaced with your own identifying information. (Don't include
185+
the brackets!) The text should be enclosed in the appropriate
186+
comment syntax for the file format. We also recommend that a
187+
file or class name and description of purpose be included on the
188+
same "printed page" as the copyright notice for easier
189+
identification within third-party archives.
190+
191+
Copyright [yyyy] [name of copyright owner]
192+
193+
Licensed under the Apache License, Version 2.0 (the "License");
194+
you may not use this file except in compliance with the License.
195+
You may obtain a copy of the License at
196+
197+
http://www.apache.org/licenses/LICENSE-2.0
198+
199+
Unless required by applicable law or agreed to in writing, software
200+
distributed under the License is distributed on an "AS IS" BASIS,
201+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202+
See the License for the specific language governing permissions and
203+
limitations under the License.

cuda_bindings/examples/0_Introduction/clock_nvrtc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021-2026 NVIDIA Corporation. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

44
# ################################################################################

cuda_bindings/examples/0_Introduction/simple_cubemap_texture.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021-2026 NVIDIA Corporation. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

44
# ################################################################################

cuda_bindings/examples/0_Introduction/simple_p2p.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021-2026 NVIDIA Corporation. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

44
# ################################################################################

cuda_bindings/examples/0_Introduction/simple_zero_copy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021-2026 NVIDIA Corporation. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

44
# ################################################################################

cuda_bindings/examples/0_Introduction/system_wide_atomics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021-2026 NVIDIA Corporation. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

44
# ################################################################################

0 commit comments

Comments
 (0)