Skip to content

Commit d393729

Browse files
[pre-commit.ci] pre-commit autoupdate (#1868)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: 5ba58aca0bd5bc7c0e1c0fc45af2e88d6a2bde83 → c60c980e561ed3e73101667fe8365c609d19a438](astral-sh/ruff-pre-commit@5ba58ac...c60c980) - [github.com/pre-commit/mirrors-mypy: a66e98df7b4aeeb3724184b332785976d062b92e → 8e5c80792e2ec0c87804d8ef915bf35e2caea6da](pre-commit/mirrors-mypy@a66e98d...8e5c807) - [github.com/rhysd/actionlint: 0933c147c9d6587653d45fdcb4c497c57a65f9af → 914e7df21a07ef503a81201c76d2b11c789d3fca](rhysd/actionlint@0933c14...914e7df) - [github.com/MarcoGorelli/cython-lint: d9ff7ce99ef4f2ae8fba93079ca9d76c4651d4ac → 7c6152f6c8f9087684ff2e09a9227941e233bafb](MarcoGorelli/cython-lint@d9ff7ce...7c6152f) * Fix cuda_core cython-lint regressions after hook update. Keep the pre-commit autoupdate green by cleaning up true dead imports and suppressing false positives from CUDA-major compile-time guards. Made-with: Cursor --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
1 parent 014f185 commit d393729

File tree

7 files changed

+15
-21
lines changed

7 files changed

+15
-21
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ci:
1515
# pre-commit autoupdate --freeze
1616
repos:
1717
- repo: https://github.com/astral-sh/ruff-pre-commit
18-
rev: 5ba58aca0bd5bc7c0e1c0fc45af2e88d6a2bde83 # frozen: v0.14.10
18+
rev: c60c980e561ed3e73101667fe8365c609d19a438 # frozen: v0.15.9
1919
hooks:
2020
- id: ruff-check
2121
args: [--fix, --show-fixes]
@@ -76,22 +76,22 @@ repos:
7676
- id: rst-inline-touching-normal
7777

7878
- repo: https://github.com/pre-commit/mirrors-mypy
79-
rev: a66e98df7b4aeeb3724184b332785976d062b92e # frozen: v1.19.1
79+
rev: 8e5c80792e2ec0c87804d8ef915bf35e2caea6da # frozen: v1.20.0
8080
hooks:
8181
- id: mypy
8282
name: mypy-pathfinder
8383
files: ^cuda_pathfinder/cuda/.*\.py$ # Exclude tests directory
8484
args: [--config-file=cuda_pathfinder/pyproject.toml]
8585

8686
- repo: https://github.com/rhysd/actionlint
87-
rev: "0933c147c9d6587653d45fdcb4c497c57a65f9af" # frozen: v1.7.10
87+
rev: "914e7df21a07ef503a81201c76d2b11c789d3fca" # frozen: v1.7.12
8888
hooks:
8989
- id: actionlint
9090
args: ["-shellcheck="]
9191
exclude: ^\.github/workflows/coverage.yml$
9292

9393
- repo: https://github.com/MarcoGorelli/cython-lint
94-
rev: "d9ff7ce99ef4f2ae8fba93079ca9d76c4651d4ac" # frozen: v0.18.0
94+
rev: "7c6152f6c8f9087684ff2e09a9227941e233bafb" # frozen: v0.19.0
9595
hooks:
9696
- id: cython-lint
9797
args: [--no-pycodestyle]

cuda_core/cuda/core/_device.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from __future__ import annotations
66

77
cimport cpython
8-
from libc.stdint cimport uintptr_t
98

109
from cuda.bindings cimport cydriver
1110
from cuda.core._utils.cuda_utils cimport HANDLE_RETURN

cuda_core/cuda/core/_memory/_managed_memory_resource.pyx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ from __future__ import annotations
66

77
from cuda.bindings cimport cydriver
88

9-
from cuda.core._memory._memory_pool cimport _MemPool, MP_init_create_pool, MP_init_current_pool
10-
from cuda.core._utils.cuda_utils cimport (
11-
HANDLE_RETURN,
12-
check_or_create_options,
13-
)
14-
from cuda.core._utils.cuda_utils import CUDAError
9+
from cuda.core._memory._memory_pool cimport _MemPool
10+
from cuda.core._memory._memory_pool cimport MP_init_create_pool, MP_init_current_pool # no-cython-lint
11+
from cuda.core._utils.cuda_utils cimport HANDLE_RETURN
12+
from cuda.core._utils.cuda_utils cimport check_or_create_options # no-cython-lint
13+
from cuda.core._utils.cuda_utils import CUDAError # no-cython-lint
1514

1615
from dataclasses import dataclass
1716
import threading

cuda_core/cuda/core/_memory/_memory_pool.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ from cuda.core._resource_handles cimport (
1616
MemoryPoolHandle,
1717
DevicePtrHandle,
1818
create_mempool_handle,
19-
create_mempool_handle_ref,
2019
deviceptr_alloc_from_pool,
2120
as_cu,
2221
as_py,
2322
)
23+
from cuda.core._resource_handles cimport create_mempool_handle_ref # no-cython-lint
2424

2525
from cuda.core._utils.cuda_utils cimport (
2626
HANDLE_RETURN,

cuda_core/cuda/core/graph/_graph_def.pyx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@ from cuda.core._resource_handles cimport (
1919
as_intptr,
2020
as_py,
2121
create_graph_handle,
22-
create_graph_handle_ref,
2322
create_graph_node_handle,
2423
)
2524
from cuda.core._utils.cuda_utils cimport HANDLE_RETURN
2625

2726
from dataclasses import dataclass
2827

29-
from cuda.core._utils.cuda_utils import driver, handle_return
28+
from cuda.core._utils.cuda_utils import driver
3029

3130

3231
cdef class Condition:
@@ -347,7 +346,7 @@ cdef class GraphDef:
347346
with nogil:
348347
HANDLE_RETURN(cydriver.cuGraphGetNodes(as_cu(self._h_graph), nodes_vec.data(), &num_nodes))
349348
350-
return set(GraphNode._create(self._h_graph, nodes_vec[i]) for i in range(num_nodes))
349+
return {GraphNode._create(self._h_graph, nodes_vec[i]) for i in range(num_nodes)}
351350
352351
def edges(self) -> set:
353352
"""Return all edges in the graph as (from_node, to_node) pairs.
@@ -386,11 +385,11 @@ cdef class GraphDef:
386385
HANDLE_RETURN(cydriver.cuGraphGetEdges(
387386
as_cu(self._h_graph), from_nodes.data(), to_nodes.data(), &num_edges))
388387
389-
return set(
388+
return {
390389
(GraphNode._create(self._h_graph, from_nodes[i]),
391390
GraphNode._create(self._h_graph, to_nodes[i]))
392391
for i in range(num_edges)
393-
)
392+
}
394393
395394
@property
396395
def handle(self) -> driver.CUgraph:

cuda_core/cuda/core/graph/_graph_node.pyx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ from cuda.core._resource_handles cimport (
4444
as_cu,
4545
as_intptr,
4646
as_py,
47-
create_event_handle_ref,
4847
create_graph_handle_ref,
4948
create_graph_node_handle,
5049
graph_node_get_graph,
@@ -59,9 +58,8 @@ from cuda.core.graph._utils cimport (
5958

6059
import weakref
6160

62-
from cuda.core import Device
6361
from cuda.core.graph._adjacency_set_proxy import AdjacencySetProxy
64-
from cuda.core._utils.cuda_utils import driver, handle_return
62+
from cuda.core._utils.cuda_utils import driver
6563

6664
# See _cpp/REGISTRY_DESIGN.md (Level 2: Resource Handle -> Python Object)
6765
_node_registry = weakref.WeakValueDictionary()

cuda_core/cuda/core/graph/_subclasses.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ from cuda.core._resource_handles cimport (
2626
create_event_handle_ref,
2727
create_graph_handle_ref,
2828
create_kernel_handle_ref,
29-
create_graph_node_handle,
3029
graph_node_get_graph,
3130
)
3231
from cuda.core._utils.cuda_utils cimport HANDLE_RETURN

0 commit comments

Comments
 (0)