Skip to content

pre-commit: bump ruff, mypy, cython-lint, and stubgen-pyx - #3209

Merged
juenglin merged 3 commits into
NVIDIA:mainfrom
juenglin:pre-commit-refresh
Oct 24, 2026
Merged

juenglin merged 3 commits into
NVIDIA:mainfrom
juenglin:pre-commit-refresh

Conversation

@juenglin

Copy link
Copy Markdown
Contributor

Routine version updates; no known CVEs in any of the bumped packages.
The hash change in .pre-commit-config.yaml also busts the pre-commit
environment cache, so CI builds fresh hook environments using pip 26.2.2
(installed by the harden-pip step added in #3197).

  • astral-sh/ruff-pre-commit v0.16.9 -> v0.17.2
    ruff 0.17.0 breaking changes (changed default Python version, removed
    some DTZ rules from defaults, added F406 to defaults) are all
    neutralized by the repo's explicit target-version="py311" setting and
    explicit "DTZ"/"F" selects in ruff.toml.

  • pre-commit/mirrors-mypy v2.3.1 -> v2.4.0
    No breaking changes.

  • MarcoGorelli/cython-lint v0.21.1 -> v0.22.0
    Adds a new lint rule for functions that are not actually inlined.
    No new failures on this codebase.

  • stubgen-pyx 0.2.22 -> 0.2.23
    Two bug fixes (unhashable class assignments, semicolon indentation).
    Cython<3.3.0 constraint is unchanged. Regenerates the .pyi header
    comments in all 51 cuda.core stubs (version string only; no signature
    changes).

Skipped (already current): security-workflows v0.4.0,
pre-commit-hooks v6.0.0, pygrep-hooks v1.10.0, actionlint v1.7.12,
lychee-bin 0.24.2.

Skipped (no vuln on pinned version; deferred): numpy 2.4.2,
Cython 3.2.9 (stubgen-pyx 0.2.23 requires <3.3.0).

Refs #3195

Signed-off-by: Ralf Juengling rjuengling@nvidia.com

Routine version updates; no known CVEs in any of the bumped packages.
The hash change in .pre-commit-config.yaml also busts the pre-commit
environment cache, so CI builds fresh hook environments using pip 26.2.2
(installed by the harden-pip step added in NVIDIA#3197).

- astral-sh/ruff-pre-commit v0.16.9 -> v0.17.2
  ruff 0.17.0 breaking changes (changed default Python version, removed
  some DTZ rules from defaults, added F406 to defaults) are all
  neutralized by the repo's explicit target-version="py311" setting and
  explicit "DTZ"/"F" selects in ruff.toml.

- pre-commit/mirrors-mypy v2.3.1 -> v2.4.0
  No breaking changes.

- MarcoGorelli/cython-lint v0.21.1 -> v0.22.0
  Adds a new lint rule for functions that are not actually inlined.
  No new failures on this codebase.

- stubgen-pyx 0.2.22 -> 0.2.23
  Two bug fixes (unhashable class assignments, semicolon indentation).
  Cython<3.3.0 constraint is unchanged. Regenerates the .pyi header
  comments in all 51 cuda.core stubs (version string only; no signature
  changes).

Skipped (already current): security-workflows v0.4.0,
pre-commit-hooks v6.0.0, pygrep-hooks v1.10.0, actionlint v1.7.12,
lychee-bin 0.24.2.

Skipped (no vuln on pinned version; deferred): numpy 2.4.2,
Cython 3.2.9 (stubgen-pyx 0.2.23 requires <3.3.0).

Refs NVIDIA#3195

Signed-off-by: Ralf Juengling <rjuengling@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the cuda.core Everything related to the cuda.core module label Oct 23, 2026
@juenglin

Copy link
Copy Markdown
Contributor Author

/ok to test 7dbf540

@jpascucci-nv jpascucci-nv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor
Doc Preview CI
Preview removed because the pull request was closed or merged.

@juenglin juenglin self-assigned this Oct 23, 2026
@juenglin juenglin added the CI/CD CI/CD infrastructure label Oct 24, 2026
cython-lint v0.22.0 reports that _check_driver_error and
_check_runtime_error are declared in cuda_utils.pxd and implemented as
`cpdef inline` in cuda_utils.pyx.  For cpdef functions visible via a
.pxd, callers in other modules always go through the Python-callable
path; Cython silently ignores the inline keyword in that case.  Remove
it to match the .pxd declarations and eliminate the misleading hint.

Signed-off-by: Ralf Juengling <rjuengling@nvidia.com>
@juenglin

Copy link
Copy Markdown
Contributor Author

/ok to test 0c8177c

@juenglin
juenglin marked this pull request as ready for review October 24, 2026 00:06
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 0c8177c and f9fc215.

Files selected for processing: 1
  • cuda_core/cuda/core/_utils/cuda_utils.pyx

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Chores
    • Updated development and code-generation tool versions and refreshed generated type information.
  • Refactor
    • Adjusted internal error-checking declarations without changing their arguments or return values.
  • Compatibility
    • No public API declarations or runtime behavior changes are included.

The pull request updates four pre-commit tool revisions, refreshes generated-stub provenance headers to stubgen-pyx 0.2.23, and removes inline from three Cython declarations. The function parameters and return declarations remain unchanged.

Changes: Tooling and stub maintenance

Layer / File(s) Summary
Pre-commit hook revisions
.pre-commit-config.yaml
The Ruff, stubgen-pyx, mypy, and cython-lint pins were updated.
Cython declaration modifiers
cuda_core/cuda/core/_utils/cuda_utils.pyx
The inline modifier was removed from _check_driver_error, _check_runtime_error, and _check_nvrtc_error.
Generated-stub provenance
cuda_core/cuda/core/*.pyi, cuda_core/cuda/core/_memory/*.pyi, cuda_core/cuda/core/_utils/*.pyi, cuda_core/cuda/core/graph/*.pyi, cuda_core/cuda/core/system/*.pyi, cuda_core/cuda/core/texture/*.pyi
Generated-file headers now identify stubgen-pyx 0.2.23 instead of 0.2.22.

Possibly related issues

Possibly related PRs

  • important: NVIDIA/cuda-python#3197: Adds a harden-pip action before pre-commit installation; both changes concern pre-commit environment setup.

Suggested reviewers: leofang

Priority: Low

Change: Other

Merge Risk: Minimal · up to f9fc2

The tooling pins and Cython declaration updates are mergeable with no identified actionable risk.

Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Missed in 0c8177c: _check_nvrtc_error is declared in cuda_utils.pxd
without `inline` but implemented as `cpdef inline` in cuda_utils.pyx,
so cython-lint v0.22.0 flags it for the same reason as the two
functions fixed in the prior commit.

Signed-off-by: Ralf Juengling <rjuengling@nvidia.com>
@juenglin juenglin added this to the cuda.bindings next milestone Oct 24, 2026
@juenglin juenglin added the ci-workflow-health Assigned to rolling issues managed by the ci-workflow-health.yml workflow. label Oct 24, 2026
@juenglin

Copy link
Copy Markdown
Contributor Author

/ok to test f9fc215

@juenglin
juenglin enabled auto-merge (squash) October 24, 2026 18:06
@juenglin
juenglin merged commit a2fb804 into NVIDIA:main Oct 24, 2026
219 of 222 checks passed
github-actions Bot pushed a commit that referenced this pull request Oct 25, 2026
Removed preview folders for the following PRs:
- PR #3198
- PR #3209
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD CI/CD infrastructure ci-workflow-health Assigned to rolling issues managed by the ci-workflow-health.yml workflow. cuda.core Everything related to the cuda.core module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants