Skip to content

Commit 5d9d37b

Browse files
committed
docs: add pixi docs env and clean repo-owned warnings
Add reproducible Pixi docs workflows for pathfinder, bindings, and core, and fix the warnings in source-owned docs and shared Sphinx extensions. Keep generated bindings module docs out of scope so the remaining warning set stays isolated to code generator output. Made-with: Cursor
1 parent d393729 commit 5d9d37b

File tree

23 files changed

+12746
-428
lines changed

23 files changed

+12746
-428
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ instance/
120120
# Sphinx documentation
121121
docs_src/_build/
122122
*/docs/source/generated/
123+
*/docs/source/module/generated/
123124

124125
# PyBuilder
125126
.pybuilder/

cuda_bindings/docs/source/conf.py

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
# -- Path setup --------------------------------------------------------------
1111

12+
import inspect
1213
import os
1314
import sys
1415
from pathlib import Path
@@ -94,7 +95,7 @@
9495
# Add any paths that contain custom static files (such as style sheets) here,
9596
# relative to this directory. They are copied after the builtin static files,
9697
# so a file named "default.css" will overwrite the builtin "default.css".
97-
html_static_path = ["_static"]
98+
html_static_path = [] # ["_static"] does not exist in our environment
9899

99100
# skip cmdline prompts
100101
copybutton_exclude = ".linenos, .gp"
@@ -107,7 +108,43 @@
107108
"cufile": ("https://docs.nvidia.com/gpudirect-storage/api-reference-guide/", None),
108109
}
109110

111+
def _sanitize_generated_docstring(lines):
112+
doc_lines = inspect.cleandoc("\n".join(lines)).splitlines()
113+
if not doc_lines:
114+
return
115+
116+
if "(" in doc_lines[0] and ")" in doc_lines[0]:
117+
doc_lines = doc_lines[1:]
118+
while doc_lines and not doc_lines[0].strip():
119+
doc_lines.pop(0)
120+
121+
if not doc_lines:
122+
lines[:] = []
123+
return
124+
125+
lines[:] = [".. code-block:: text", ""]
126+
lines.extend(f" {line}" if line else " " for line in doc_lines)
127+
128+
129+
def autodoc_process_docstring(app, what, name, obj, options, lines):
130+
if name.startswith("cuda.bindings."):
131+
_sanitize_generated_docstring(lines)
132+
133+
134+
def rewrite_source(app, docname, source):
135+
text = source[0]
136+
137+
if docname.startswith("release/"):
138+
text = text.replace(".. module:: cuda.bindings\n\n", "", 1)
139+
140+
source[0] = text
141+
110142
suppress_warnings = [
111143
# for warnings about multiple possible targets, see NVIDIA/cuda-python#152
112144
"ref.python",
113145
]
146+
147+
148+
def setup(app):
149+
app.connect("autodoc-process-docstring", autodoc_process_docstring)
150+
app.connect("source-read", rewrite_source)

cuda_bindings/docs/source/contribute.rst

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@
44
Contributing
55
============
66

7-
Thank you for your interest in contributing to ``cuda-bindings``! Based on the type of contribution, it will fall into two categories:
8-
9-
1. You want to report a bug, feature request, or documentation issue
10-
- File an `issue <https://github.com/NVIDIA/cuda-python/issues/new/choose>`_ describing what you encountered or what you want to see changed.
11-
- The NVIDIA team will evaluate the issues and triage them, scheduling
12-
them for a release. If you believe the issue needs priority attention
13-
comment on the issue to notify the team.
14-
2. You want to implement a feature, improvement, or bug fix:
15-
- At this time we do not accept code contributions.
7+
Thank you for your interest in contributing to ``cuda-bindings``! Based on the
8+
type of contribution, it will fall into two categories:
9+
10+
1. You want to report a bug, feature request, or documentation issue.
11+
12+
File an `issue <https://github.com/NVIDIA/cuda-python/issues/new/choose>`_
13+
describing what you encountered or what you want to see changed. The NVIDIA
14+
team will evaluate the issue, triage it, and schedule it for a release. If
15+
you believe the issue needs priority attention, comment on the issue to
16+
notify the team.
17+
18+
2. You want to implement a feature, improvement, or bug fix.
19+
20+
At this time we do not accept code contributions.

cuda_bindings/docs/source/install.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Installing from Source
7878
----------------------
7979

8080
Requirements
81-
^^^^^^^^^^^^
81+
~~~~~~~~~~~~
8282

8383
* CUDA Toolkit headers[^1]
8484
* CUDA Runtime static library[^2]
@@ -100,7 +100,7 @@ See `Environment Variables <environment_variables.rst>`_ for a description of ot
100100
Only ``cydriver``, ``cyruntime`` and ``cynvrtc`` are impacted by the header requirement.
101101

102102
Editable Install
103-
^^^^^^^^^^^^^^^^
103+
~~~~~~~~~~~~~~~~
104104

105105
You can use:
106106

cuda_bindings/docs/source/overview.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ code into
2525
`PTX <https://docs.nvidia.com/cuda/parallel-thread-execution/index.html>`_ and
2626
then extract the function to be called at a later point in the application. You
2727
construct your device code in the form of a string and compile it with
28-
`NVRTC <http://docs.nvidia.com/cuda/nvrtc/index.html>`_, a runtime compilation
28+
`NVRTC <https://docs.nvidia.com/cuda/nvrtc/index.html>`_, a runtime compilation
2929
library for CUDA C++. Using the NVIDIA `Driver
30-
API <http://docs.nvidia.com/cuda/cuda-driver-api/index.html>`_, manually create a
30+
API <https://docs.nvidia.com/cuda/cuda-driver-api/index.html>`_, manually create a
3131
CUDA context and all required resources on the GPU, then launch the compiled
3232
CUDA C++ code and retrieve the results from the GPU. Now that you have an
3333
overview, jump into a commonly used example for parallel programming:
@@ -427,7 +427,7 @@ Putting it all together:
427427
)
428428
429429
The final step is to construct a ``kernelParams`` argument that fulfills all of the launch API conditions. This is made easy because each array object comes
430-
with a `ctypes <https://numpy.org/doc/stable/reference/generated/numpy.ndarray.ctypes.html#numpy.ndarray.ctypes>`_ data attribute that returns the underlying ``void*`` pointer value.
430+
with NumPy's `ctypes data attribute <https://numpy.org/doc/stable/reference/generated/numpy.ndarray.ctypes.html#numpy.ndarray.ctypes>`_ that returns the underlying ``void*`` pointer value.
431431

432432
By having the final array object contain all pointers, we fulfill the contiguous array requirement:
433433

cuda_bindings/docs/source/release/11.8.6-notes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
33
44
``cuda-bindings`` 11.8.6 Release notes
5-
====================================
5+
==========================================
66

77
Released on January 24, 2025.
88

cuda_bindings/docs/source/release/12.8.0-notes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
33
44
``cuda-bindings`` 12.8.0 Release notes
5-
====================================
5+
==========================================
66

77
Released on January 24, 2025.
88

0 commit comments

Comments
 (0)