Skip to content

Commit c3e1180

Browse files
authored
docs: add pixi docs env and clean repo-owned warnings (#1870)
* 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 * style: apply ruff formatting fixes Apply the formatter changes required by pre-commit.ci so the docs helper updates match repository formatting rules. Made-with: Cursor * docs: fail pathfinder and core builds on warnings Enable `-W --keep-going` for the pathfinder and core Sphinx builds so warning regressions fail the docs workflow while still reporting the full warning set. Made-with: Cursor * docs: dedupe cuda_core docs task wiring Remove the redundant cuda_core build-docs alias and point the repo-root docs task at the canonical docs-build target so the post-rebase docs workflow stays consistent. Made-with: Cursor
1 parent f80b085 commit c3e1180

File tree

22 files changed

+8744
-353
lines changed

22 files changed

+8744
-353
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: 40 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
@@ -103,7 +104,7 @@ def _github_examples_ref():
103104
# Add any paths that contain custom static files (such as style sheets) here,
104105
# relative to this directory. They are copied after the builtin static files,
105106
# so a file named "default.css" will overwrite the builtin "default.css".
106-
html_static_path = ["_static"]
107+
html_static_path = [] # ["_static"] does not exist in our environment
107108

108109
# skip cmdline prompts
109110
copybutton_exclude = ".linenos, .gp"
@@ -120,7 +121,45 @@ def _github_examples_ref():
120121
"cufile": ("https://docs.nvidia.com/gpudirect-storage/api-reference-guide/", None),
121122
}
122123

124+
125+
def _sanitize_generated_docstring(lines):
126+
doc_lines = inspect.cleandoc("\n".join(lines)).splitlines()
127+
if not doc_lines:
128+
return
129+
130+
if "(" in doc_lines[0] and ")" in doc_lines[0]:
131+
doc_lines = doc_lines[1:]
132+
while doc_lines and not doc_lines[0].strip():
133+
doc_lines.pop(0)
134+
135+
if not doc_lines:
136+
lines[:] = []
137+
return
138+
139+
lines[:] = [".. code-block:: text", ""]
140+
lines.extend(f" {line}" if line else " " for line in doc_lines)
141+
142+
143+
def autodoc_process_docstring(app, what, name, obj, options, lines):
144+
if name.startswith("cuda.bindings."):
145+
_sanitize_generated_docstring(lines)
146+
147+
148+
def rewrite_source(app, docname, source):
149+
text = source[0]
150+
151+
if docname.startswith("release/"):
152+
text = text.replace(".. module:: cuda.bindings\n\n", "", 1)
153+
154+
source[0] = text
155+
156+
123157
suppress_warnings = [
124158
# for warnings about multiple possible targets, see NVIDIA/cuda-python#152
125159
"ref.python",
126160
]
161+
162+
163+
def setup(app):
164+
app.connect("autodoc-process-docstring", autodoc_process_docstring)
165+
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:
@@ -428,7 +428,7 @@ Putting it all together:
428428
)
429429
430430
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
431-
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.
431+
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.
432432

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

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)