Skip to content

Commit f5fafa3

Browse files
authored
MAINT: Upgrade stubgen-pyx to 0.2.19 (#2653)
* Upgrade stubgen-pyx to 0.2.19 * ci: show diff on pre-commit failure to diagnose Windows stubgen mismatch Temporary diagnostic to see what content actually differs when the stubgen-pyx-cuda-core hook reports modified files on Windows CI. * Fix Windows encoding issue
1 parent 8d526ec commit f5fafa3

54 files changed

Lines changed: 754 additions & 2141 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.pre-commit-config.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ repos:
8383

8484
- id: stubgen-pyx-cuda-core
8585
name: Generate .pyi stubs for cuda_core
86-
entry: python ./toolshed/run_stubgen_pyx.py
86+
entry: python -X utf8 -m stubgen_pyx cuda_core/cuda --continue-on-error --include-private
8787
language: python
8888
files: ^cuda_core/cuda/.*\.(pyx|pxd)$
8989
pass_filenames: false
9090
additional_dependencies:
91-
- stubgen-pyx==0.2.6
91+
- stubgen-pyx==0.2.19
9292
- Cython==3.2.9
9393

9494
# Link checking for authored documentation files

‎cuda_core/cuda/core/_context.pyi‎

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_context.pyx
2-
3-
from __future__ import annotations
1+
# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_context.pyx
42

53
from collections.abc import Sequence
64
from dataclasses import dataclass
@@ -10,32 +8,24 @@ from cuda.core._device_resources import (DeviceResources, SMResource,
108
WorkqueueResource)
119
from cuda.core._stream import Stream
1210

11+
__all__ = ['Context', 'ContextOptions']
12+
DeviceResourcesType = Sequence[SMResource | WorkqueueResource]
1313

1414
class Context:
1515
"""CUDA context wrapper.
1616
1717
Context objects represent CUDA contexts and cannot be instantiated directly.
1818
Use Device or Stream APIs to obtain context objects.
1919
"""
20-
21-
def close(self):
22-
"""Release this context wrapper's underlying CUDA handles."""
23-
24-
def __init__(self, *args, **kwargs) -> None:
25-
...
26-
20+
def __init__(self, *args, **kwargs) -> None: ...
2721
@property
2822
def handle(self) -> cuda.bindings.driver.CUcontext | None:
2923
"""Return the underlying CUcontext handle."""
30-
3124
@property
32-
def _handle(self) -> cuda.bindings.driver.CUcontext | None:
33-
...
34-
25+
def _handle(self) -> cuda.bindings.driver.CUcontext | None: ...
3526
@property
3627
def is_green(self) -> bool:
3728
"""True if this context was created from device resources."""
38-
3929
@property
4030
def resources(self) -> DeviceResources:
4131
"""Query the hardware resources provisioned for this context.
@@ -46,8 +36,7 @@ class Context:
4636
4737
Raises :class:`RuntimeError` if the context has been closed.
4838
"""
49-
50-
def create_stream(self, options: object=None) -> Stream:
39+
def create_stream(self, options: object | None=None) -> Stream:
5140
"""Create a new stream bound to this green context.
5241
5342
This method is only available on green contexts. For primary
@@ -63,15 +52,11 @@ class Context:
6352
:obj:`~_stream.Stream`
6453
Newly created stream object.
6554
"""
66-
67-
def __eq__(self, other: object) -> bool:
68-
...
69-
70-
def __hash__(self) -> int:
71-
...
72-
73-
def __repr__(self) -> str:
74-
...
55+
def close(self):
56+
"""Release this context wrapper's underlying CUDA handles."""
57+
def __eq__(self, other: object) -> bool: ...
58+
def __hash__(self) -> int: ...
59+
def __repr__(self) -> str: ...
7560

7661
@dataclass
7762
class ContextOptions:
@@ -83,5 +68,3 @@ class ContextOptions:
8368
Device resources used to create a green context.
8469
"""
8570
resources: DeviceResourcesType
86-
__all__ = ['Context', 'ContextOptions']
87-
DeviceResourcesType = Sequence[SMResource | WorkqueueResource]

0 commit comments

Comments
 (0)