Skip to content

Commit b69022b

Browse files
committed
Address findings in PR
1 parent 5a4a178 commit b69022b

4 files changed

Lines changed: 19 additions & 17 deletions

File tree

‎cuda_core/cuda/core/_memory/_ipc.pyi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class IPCAllocationHandle:
8484
@property
8585
def uuid(self) -> uuid.UUID:
8686
...
87-
__all__ = ['IPCBufferDescriptor', 'IPCAllocationHandle']
87+
__all__ = []
8888

8989
def _reduce_allocation_handle(alloc_handle: IPCAllocationHandle) -> tuple[object, ...]:
9090
...

‎cuda_core/cuda/core/_memory/_ipc.pyx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import platform
2929
import uuid
3030
import weakref
3131

32-
__all__ = ['IPCBufferDescriptor', 'IPCAllocationHandle']
32+
__all__ = []
3333

3434

3535
cdef object registry = weakref.WeakValueDictionary()

‎cuda_core/docs/source/api_private.rst‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@ CUDA runtime
4040
typing.VirtualMemoryGranularityType
4141
typing.VirtualMemoryHandleType
4242
typing.VirtualMemoryLocationType
43+
typing.WorkqueueSharingScopeType
4344

4445
:template: autosummary/cyclass.rst
4546

4647
DeviceResources
4748
_device.DeviceProperties
48-
IPCAllocationHandle
49-
IPCBufferDescriptor
49+
_memory._ipc.IPCAllocationHandle
50+
_memory._ipc.IPCBufferDescriptor
5051
_memory._managed_buffer.AccessedBySetProxy
5152

5253

‎cuda_core/tests/test_api_docs_consistency.py‎

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
"""Consistency checks between the public ``__all__`` surface and the API docs.
66
7-
Covers the flat ``cuda.core`` namespace and every public subpackage
8-
(``graph``, ``system``, ``texture``, ``utils``, and any added later) discovered
9-
automatically from ``cuda.core.__path__``. For each public namespace, exported
10-
``__all__`` names must appear somewhere in ``cuda_core/docs/source``.
7+
Covers the flat ``cuda.core`` namespace and every public submodule
8+
(``checkpoint``, ``graph``, ``system``, ``texture``, ``typing``, ``utils``,
9+
and any added later) discovered automatically from ``cuda.core.__path__``.
10+
For each public namespace, exported ``__all__`` names must appear somewhere
11+
in ``cuda_core/docs/source``.
1112
1213
The enforced direction is deliberately one-way (public export -> documented).
1314
This is intentionally a *name-presence* check, and it does not verify:
@@ -46,10 +47,10 @@
4647
# those are an internal packaging mechanism, not public API.
4748
_VERSIONED_SUBPACKAGE = re.compile(r"^cu\d+$")
4849

49-
PUBLIC_SUBPACKAGES = sorted(
50+
PUBLIC_SUBMODULES = sorted(
5051
name
5152
for _, name, ispkg in pkgutil.iter_modules(cuda.core.__path__)
52-
if ispkg and not name.startswith("_") and not _VERSIONED_SUBPACKAGE.match(name)
53+
if not name.startswith("_") and not _VERSIONED_SUBPACKAGE.match(name)
5354
)
5455

5556

@@ -157,7 +158,7 @@ def _add_documented_name(documented, module, entry):
157158
documented[module].add(entry)
158159
return
159160
sub, name = entry.split(".", 1)
160-
if sub in PUBLIC_SUBPACKAGES and "." not in name:
161+
if sub in PUBLIC_SUBMODULES and "." not in name:
161162
documented[f"cuda.core.{sub}"].add(name)
162163
return
163164
if module.startswith("cuda.core."):
@@ -176,7 +177,7 @@ def _documented_names(docs_dir, *, exclude=frozenset()):
176177
return documented
177178

178179

179-
PUBLIC_NAMESPACES = ("cuda.core", *(f"cuda.core.{sub}" for sub in PUBLIC_SUBPACKAGES))
180+
PUBLIC_NAMESPACES = ("cuda.core", *(f"cuda.core.{sub}" for sub in PUBLIC_SUBMODULES))
180181

181182

182183
@pytest.fixture(scope="module")
@@ -199,10 +200,10 @@ def documented(docs_dir):
199200

200201

201202
@pytest.mark.human_authored
202-
def test_public_subpackages_discovered():
203+
def test_public_submodules_discovered():
203204
# Guards against a broken __path__ walk silently turning every
204-
# parametrized subpackage check into a no-op.
205-
assert PUBLIC_SUBPACKAGES, "no public cuda.core subpackages were discovered"
205+
# parametrized submodule check into a no-op.
206+
assert PUBLIC_SUBMODULES, "no public cuda.core submodules were discovered"
206207

207208

208209
@pytest.mark.human_authored
@@ -219,7 +220,7 @@ def test_main_package_symbols_are_documented(exported, documented):
219220
assert not undocumented, f"public by cuda.core.__all__ but missing from docs/source/*.rst: {sorted(undocumented)}"
220221

221222

222-
@pytest.mark.parametrize("sub", PUBLIC_SUBPACKAGES)
223+
@pytest.mark.parametrize("sub", PUBLIC_SUBMODULES)
223224
def test_subpackage_symbols_define_all(sub):
224225
module = importlib.import_module(f"cuda.core.{sub}")
225226
assert hasattr(module, "__all__"), f"cuda.core.{sub} does not define __all__"
@@ -228,7 +229,7 @@ def test_subpackage_symbols_define_all(sub):
228229

229230

230231
@pytest.mark.human_authored
231-
@pytest.mark.parametrize("sub", PUBLIC_SUBPACKAGES)
232+
@pytest.mark.parametrize("sub", PUBLIC_SUBMODULES)
232233
def test_subpackage_exports_are_documented(sub, documented):
233234
documented = documented[f"cuda.core.{sub}"]
234235
module = importlib.import_module(f"cuda.core.{sub}")

0 commit comments

Comments
 (0)