Repository navigation
pre-commit: bump ruff, mypy, cython-lint, and stubgen-pyx - #3209
Conversation
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>
|
/ok to test 7dbf540 |
|
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>
|
/ok to test 0c8177c |
|
No actionable comments were generated in the recent review.
|
| 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
- suggestion: Upgrade certifi, pip, uv, ca-certificates, and pixi for the eMudhra/emSign CA incident #3195: The issue describes pre-commit cache behavior keyed to
.pre-commit-config.yaml; this pull request changes that configuration’s pinned revisions.
Possibly related PRs
- important: NVIDIA/cuda-python#3197: Adds a
harden-pipaction before pre-commit installation; both changes concern pre-commit environment setup.
Suggested reviewers: leofang
Priority:
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>
|
/ok to test f9fc215 |
| @@ -197,7 +197,7 @@ cpdef inline int _check_driver_error(cydriver.CUresult error) except?-1 nogil: | |||
| raise exc | |||
|
|
|||
|
|
|||
| cpdef inline int _check_runtime_error(error) except?-1: | |||
| cpdef int _check_runtime_error(error) except?-1: | |||
| if error == _RUNTIME_SUCCESS: | |||
| return 0 | |||
| # `_check_error()` reaches this path only for `runtime.cudaError_t` values. | |||
| @@ -213,7 +213,7 @@ cpdef inline int _check_runtime_error(error) except?-1: | |||
| raise CUDAError(f"{name}: {desc}") | |||
|
|
|||
|
|
|||
| cpdef inline int _check_nvrtc_error(error, handle=None) except?-1: | |||
| cpdef int _check_nvrtc_error(error, handle=None) except?-1: | |||
There was a problem hiding this comment.
Sorry to find this after-the-fact, but fixing the linter in this way creates a performance regression. Prior to this change, these functions were at least inlined within the same file. Since these are on the hot path, this is important. After this change, they aren't inlined anywhere. We need to follow up by moving the function definitions to the .pxd file, (and restoring the inline keyword there) not just removing the inline keyword. Cc: @juenglin
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