Skip to content

Commit 872908c

Browse files
committed
Merge remote-tracking branch 'origin/main' into pr-2235
# Conflicts: # cuda_core/cuda/core/_utils/cuda_utils.pyi
2 parents e805473 + 1723666 commit 872908c

504 files changed

Lines changed: 72769 additions & 51035 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
---
2+
name: create-cuda-python-pull-request
3+
description: Create a CUDA Python pull request from an approved personal or organization-owned fork, including the GitHub CLI GraphQL fallback for renamed organization-owned forks. Use when the user directly requests creating or opening a CUDA Python pull request. Do not use for local implementation, commits, pushes, branch preparation, PR advice, or general GitHub work without that direct request.
4+
---
5+
6+
# Create CUDA Python Pull Request
7+
8+
This skill supplies technical procedure after the user directly asks to create
9+
a pull request. It does not define when a pull request should be created or
10+
authorize one without that direct request. Do not infer the request from
11+
completed work, a local commit, a push request, or the existence of a suitable
12+
fork.
13+
14+
## Inspect the topology and proposed change
15+
16+
1. Run `git status --short --branch`, inspect the branch diff, and confirm the
17+
intended base branch.
18+
2. Run `git remote -v` and resolve the complete `OWNER/REPOSITORY` names of the
19+
base repository and intended fork. Do not rely on remote names alone.
20+
3. Confirm through GitHub that the push target is a fork of the base repository
21+
and is not the base repository itself.
22+
4. Confirm that the intended push target complies with the repository's
23+
remote-write policy and the user's request.
24+
5. Inspect the repository's pull-request template, available labels, and open
25+
milestones. Do not guess required metadata; ask the user when it is unclear.
26+
27+
## Validate and push
28+
29+
Run the checks appropriate to the change and review the final diff. Push the
30+
current branch to the approved fork using the explicit remote and branch:
31+
32+
```bash
33+
git push <fork-remote> <branch>
34+
```
35+
36+
## Create the pull request
37+
38+
Prepare a complete body from the repository's pull-request template. Every
39+
pull request must have at least one assignee, one label, and a milestone; CI
40+
enforces this through `pr-metadata-check`.
41+
42+
Use `gh pr create` when it can identify the fork unambiguously. Select the base
43+
repository and branch explicitly and supply the required metadata:
44+
45+
```bash
46+
gh pr create \
47+
--repo <base-owner>/<base-repository> \
48+
--base <base-branch> \
49+
--head <fork-owner>:<head-branch> \
50+
--title "<title>" \
51+
--body-file <path-to-pr-body> \
52+
--assignee <assignee> \
53+
--label <label> \
54+
--milestone <milestone>
55+
```
56+
57+
Add `--draft` when the user requests a draft pull request.
58+
59+
## Handle renamed organization-owned forks
60+
61+
[GitHub CLI issue cli/cli#10093](https://github.com/cli/cli/issues/10093)
62+
tracks `gh pr create` support for cross-repository pull requests within one
63+
organization. Check whether the issue has been resolved before using the
64+
workaround.
65+
66+
If `gh pr create` cannot identify an organization-owned fork whose repository
67+
name differs from the base repository, create the pull request with GitHub's
68+
GraphQL API and pass `headRepositoryId` explicitly.
69+
70+
Resolve the repository node IDs:
71+
72+
```bash
73+
BASE_REPO="<base-owner>/<base-repository>"
74+
HEAD_REPO="<fork-owner>/<fork-repository>"
75+
BASE_REPO_ID="$(gh api "repos/${BASE_REPO}" --jq '.node_id')"
76+
HEAD_REPO_ID="$(gh api "repos/${HEAD_REPO}" --jq '.node_id')"
77+
```
78+
79+
Create the pull request. Set `draft` to match the user's request.
80+
81+
```bash
82+
gh api graphql \
83+
-f repositoryId="${BASE_REPO_ID}" \
84+
-f headRepositoryId="${HEAD_REPO_ID}" \
85+
-f baseRefName="<base-branch>" \
86+
-f headRefName="<head-branch>" \
87+
-f title="<title>" \
88+
-F body="@<path-to-pr-body>" \
89+
-F draft=false \
90+
-f query='
91+
mutation CreatePullRequest(
92+
$repositoryId: ID!
93+
$headRepositoryId: ID!
94+
$baseRefName: String!
95+
$headRefName: String!
96+
$title: String!
97+
$body: String!
98+
$draft: Boolean!
99+
) {
100+
createPullRequest(input: {
101+
repositoryId: $repositoryId
102+
headRepositoryId: $headRepositoryId
103+
baseRefName: $baseRefName
104+
headRefName: $headRefName
105+
title: $title
106+
body: $body
107+
draft: $draft
108+
}) {
109+
pullRequest { number url }
110+
}
111+
}' \
112+
--jq '.data.createPullRequest.pullRequest'
113+
```
114+
115+
The GraphQL API does not populate the pull-request template automatically.
116+
After creation, add the required metadata to the returned pull-request number:
117+
118+
```bash
119+
gh pr edit <pr-number> \
120+
--repo "${BASE_REPO}" \
121+
--add-assignee "<assignee>" \
122+
--add-label "<label>" \
123+
--milestone "<milestone>"
124+
```
125+
126+
Verify the resulting URL, base branch, head repository and branch, draft state,
127+
body, assignee, label, and milestone before reporting completion.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
interface:
6+
display_name: "Create CUDA Python PR"
7+
short_description: "Open an explicitly requested CUDA Python pull request"
8+
default_prompt: "Use $create-cuda-python-pull-request to create the CUDA Python pull request I explicitly requested."
9+
policy:
10+
allow_implicit_invocation: true

‎.coveragerc‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ plugins = Cython.Coverage
1111
core = ctrace
1212
branch = False
1313
relative_files = True
14-
# Omits specific definition files that causes plugin errors
14+
# Cython.Coverage cannot build a FileReporter for .pxd/.pxi (not standalone
15+
# translation units). Pattern in [run], not an enumeration: a new file of
16+
# either kind otherwise breaks `coverage html`. Must be [run], not [report].
1517
omit =
16-
*/windll.pxd
17-
*/_lib/windll.pxd
18-
*/_lib/utils.pxd
18+
*/*.pxd
19+
*/*.pxi
1920

2021
[report]
2122
show_missing = true

‎.github/ISSUE_TEMPLATE/release_checklist.yml‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ body:
2020
- label: File an internal nvbug to communicate test plan & release schedule with QA
2121
- label: Ensure all pending PRs are reviewed, tested, and merged
2222
- label: Check (or update if needed) the dependency requirements
23+
- label: Sweep deprecations whose stated removal version has arrived (`grep -rn 'deprecated::' cuda_core/cuda`) and remove any that are due
2324
- label: "Finalize the doc update, including release notes (\"Note: Touching docstrings/type annotations in code is OK during code freeze, apply your best judgement!\")"
2425
- label: Update the docs for the new version
2526
- label: Create a public release tag
26-
- label: Wait for the tag-triggered CI run to complete, and use that run ID for release workflows
27-
- label: If any code change happens, rebuild the wheels from the new tag
28-
- label: Upload wheels to PyPI
29-
- label: Update the conda recipe & release conda packages
27+
- label: Wait for the tag-triggered CI run to complete, and use that run ID for release workflows (this will upload the release to PyPI)
28+
- label: Publish the release at https://github.com/NVIDIA/cuda-python/releases (this will trigger the conda package update)
29+
- label: Approve the conda-package update PR
3030
- label: Post-release QA
3131
- label: Finalize the announcement update
32-
- label: Send out the announcement internally
32+
- label: Send out the announcement internally (on `#swcuda-python`)
3333
- label: Send out the announcement externally (GitHub Release -> Announcement)
34+
- label: For a `cuda-bindings` release, make sure MAJOR and MAJOR-1 releases are made, as well as releases of `cuda-python` for MAJOR and MAJOR-1

‎.github/RELEASE-core.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,29 @@ platforms as appropriate for each release.
6464
Review `cuda_core/pyproject.toml` and verify that all dependency
6565
requirements are current.
6666

67+
Update the cuda_core dependency in `cuda_python/setup.py`.
68+
69+
---
70+
71+
## Sweep deprecations whose removal version has arrived
72+
73+
Deprecated APIs are marked in the source with a Sphinx `deprecated`
74+
directive naming the version that introduced the deprecation, and their
75+
docstrings state the version in which they will be removed. Find them all
76+
with:
77+
78+
```console
79+
$ grep -rn 'deprecated::' cuda_core/cuda
80+
```
81+
82+
For each hit, check the stated removal version against the version being
83+
released. If the release has reached or passed it, remove the API, its
84+
runtime `DeprecationWarning`, and any tests asserting that warning.
85+
86+
This must happen *before* the release tag is cut. Removals are breaking
87+
changes, so they are only permitted at a major-version boundary per the
88+
[support policy](https://nvidia.github.io/cuda-python/cuda-core/latest/support.html).
89+
6790
---
6891

6992
## Finalize the doc update, including release notes

‎.github/actionlint.yaml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,10 @@ self-hosted-runner:
88
labels:
99
- linux-amd64-cpu8
1010
- linux-amd64-gpu-l4-latest-1
11+
12+
# GitHub supports queued concurrency runs, but the latest actionlint release
13+
# does not yet recognize the concurrency.queue key.
14+
paths:
15+
".github/workflows/ci-workflow-health.yml":
16+
ignore:
17+
- 'unexpected key "queue" for "concurrency" section'

‎.github/actions/fetch_ctk/action.yml‎

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ runs:
7979
function extract() {
8080
tar -xvf $1 -C $CACHE_TMP_DIR --strip-components=1
8181
}
82-
elif [[ "${{ inputs.host-platform }}" == "win-64" ]]; then
82+
elif [[ "${{ inputs.host-platform }}" == win* ]]; then
8383
function extract() {
8484
_TEMP_DIR_=$(mktemp -d)
8585
unzip $1 -d $_TEMP_DIR_
@@ -120,8 +120,12 @@ runs:
120120
# Note: try to escape | and > ...
121121
tar -czvf ${CTK_CACHE_FILENAME} ${CACHE_TMP_DIR}
122122
123-
# "Move" files from temp dir to CUDA_PATH
124-
CUDA_PATH="./cuda_toolkit"
123+
# Populate the final CUDA_PATH directly (never stage through ./cuda_toolkit
124+
# unconditionally — a second call with a different cuda-path would leave
125+
# symlinks from a prerelease CTK at ./cuda_toolkit/include etc., causing
126+
# "cp: cannot overwrite non-directory" failures on the next restore).
127+
CUDA_PATH="${{ inputs.cuda-path }}"
128+
rm -rf $CUDA_PATH
125129
mkdir -p $CUDA_PATH
126130
# Unfortunately we cannot use "rsync -av $CACHE_TMP_DIR/ $CUDA_PATH" because
127131
# not all runners have rsync pre-installed (or even installable, such as
@@ -144,22 +148,14 @@ runs:
144148
run: |
145149
ls -l
146150
CACHE_TMP_DIR="./cache_tmp_dir"
147-
CUDA_PATH="./cuda_toolkit"
151+
CUDA_PATH="${{ inputs.cuda-path }}"
152+
rm -rf $CUDA_PATH
148153
mkdir -p $CUDA_PATH
149154
tar -xzvf $CTK_CACHE_FILENAME
150155
# Can't use rsync here, see above
151156
cp -r $CACHE_TMP_DIR/* $CUDA_PATH
152157
rm -rf $CACHE_TMP_DIR $CTK_CACHE_FILENAME
153158
ls -l $CUDA_PATH
154-
if [ ! -d "$CUDA_PATH/include" ]; then
155-
exit 1
156-
fi
157-
158-
- name: Move CTK to the specified location
159-
if: ${{ inputs.cuda-path != './cuda_toolkit' }}
160-
shell: bash --noprofile --norc -xeuo pipefail {0}
161-
run: |
162-
mv ./cuda_toolkit ${{ inputs.cuda-path }}
163159
164160
- name: Set output environment variables
165161
shell: bash --noprofile --norc -xeuo pipefail {0}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: Setup pinned pixi
6+
description: Install the repository's canonical pixi version without installing an environment
7+
8+
outputs:
9+
pixi-version:
10+
description: The canonical pixi version installed by this action
11+
value: ${{ steps.version.outputs.pixi-version }}
12+
13+
runs:
14+
using: composite
15+
steps:
16+
- name: Read canonical pixi version
17+
id: version
18+
shell: bash --noprofile --norc -euo pipefail {0}
19+
run: |
20+
source "${GITHUB_WORKSPACE}/ci/pixi-version.env"
21+
if [[ ! "${PIXI_VERSION:-}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
22+
echo "::error::ci/pixi-version.env must set PIXI_VERSION in vMAJOR.MINOR.PATCH form"
23+
exit 1
24+
fi
25+
echo "pixi-version=${PIXI_VERSION}" >> "${GITHUB_OUTPUT}"
26+
27+
- name: Setup pixi ${{ steps.version.outputs.pixi-version }}
28+
# Pinned to a commit SHA; install logic lives in the action and is
29+
# auditable/pinned (vs. a curl|bash of an unverified installer).
30+
uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6
31+
with:
32+
pixi-version: ${{ steps.version.outputs.pixi-version }}
33+
run-install: false

‎.github/workflows/backport.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
}}
3535
runs-on: ubuntu-latest
3636
steps:
37-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
37+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3838

3939
- name: Load branch name
4040
id: get-branch
@@ -43,7 +43,7 @@ jobs:
4343
echo "OLD_BRANCH=${OLD_BRANCH}" >> $GITHUB_ENV
4444
4545
- name: Create backport pull requests
46-
uses: korthout/backport-action@66065406958f46e82238fd59546f5a99e69e22aa # v4.5.2
46+
uses: korthout/backport-action@2e830a1d0b8269505846ddd407a70876913ad1f8 # v4.6.0
4747
with:
4848
copy_assignees: true
4949
copy_labels_pattern: true
@@ -54,7 +54,7 @@ jobs:
5454
if: github.repository_owner == 'nvidia' && github.event_name == 'workflow_dispatch'
5555
runs-on: ubuntu-latest
5656
steps:
57-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
57+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
5858

5959
- name: Load branch from environment name
6060
if: inputs.backport-branch == null
@@ -67,7 +67,7 @@ jobs:
6767
run: echo "BACKPORT_BRANCH=${{ inputs.backport-branch }}" >> $GITHUB_ENV
6868

6969
- name: Create backport pull requests
70-
uses: korthout/backport-action@66065406958f46e82238fd59546f5a99e69e22aa # v4.5.2
70+
uses: korthout/backport-action@2e830a1d0b8269505846ddd407a70876913ad1f8 # v4.6.0
7171
with:
7272
copy_assignees: true
7373
copy_labels_pattern: true

‎.github/workflows/bandit.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
security-events: write
2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
26+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2727

2828
- name: Install uv
29-
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
29+
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
3030
with:
3131
enable-cache: false
3232

@@ -41,10 +41,10 @@ jobs:
4141
4242
echo "codes=$(uvx toml2json ./ruff.toml | jq -r '.lint.ignore | map(select(test("^S\\d+"))) | join(",")')" >> "$GITHUB_OUTPUT"
4343
- name: Perform Bandit Analysis using Ruff
44-
uses: astral-sh/ruff-action@0ce1b0bf8b818ef400413f810f8a11cdbda0034b # v4.0.0
44+
uses: astral-sh/ruff-action@278981a28ce3188b1e39527901f38254bf3aac89 # v4.1.0
4545
with:
4646
args: "check --select S --ignore ${{ steps.ignore-codes.outputs.codes }} --output-format sarif --output-file results.sarif"
4747
- name: Upload SARIF file
48-
uses: github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
48+
uses: github/codeql-action/upload-sarif@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
4949
with:
5050
sarif_file: results.sarif

0 commit comments

Comments
 (0)