Skip to content

docs: audit example coverage in published docs#1866

Merged
cpcloud merged 3 commits intoNVIDIA:mainfrom
cpcloud:audit-examples-1680
Apr 8, 2026
Merged

docs: audit example coverage in published docs#1866
cpcloud merged 3 commits intoNVIDIA:mainfrom
cpcloud:audit-examples-1680

Conversation

@cpcloud
Copy link
Copy Markdown
Contributor

@cpcloud cpcloud commented Apr 6, 2026

Summary

  • add dedicated examples pages for cuda.core and cuda.bindings so every shipped example is linked from the published docs
  • update the existing doc entry points to link the new example indexes, fix the stale strided_memory_view.py reference, and follow the snake_case bindings example rename from Fix #1841: Rename examples #1847
  • make the new GitHub example links version-aware so release docs point at the matching package tag while latest and preview builds continue to point at main

Test plan

  • bash -n cuda_core/docs/build_docs.sh
  • bash -n cuda_bindings/docs/build_docs.sh
  • git diff --check
  • Verified the new docs pages reference the current cuda_core/examples/*.py and cuda_bindings/examples/**/*.py files after the Fix #1841: Rename examples #1847 rename

Closes #1680.

Made with Cursor

@cpcloud cpcloud added this to the cuda.core v1.0.0 milestone Apr 6, 2026
@cpcloud cpcloud added the documentation Improvements or additions to documentation label Apr 6, 2026
@cpcloud cpcloud self-assigned this Apr 6, 2026
@cpcloud cpcloud added cuda.bindings Everything related to the cuda.bindings module cuda.core Everything related to the cuda.core module labels Apr 6, 2026
@cpcloud cpcloud requested a review from rparolin April 6, 2026 17:45
@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Contributor

@mdboom mdboom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably incorporate #1847 (which is just a renaming of the example files to snake_case) either before or as part of this.

Introduction
------------

- `clock_nvrtc_test.py <https://github.com/NVIDIA/cuda-python/blob/main/cuda_bindings/examples/0_Introduction/clock_nvrtc_test.py>`_
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to link to main on github? I worry the examples could get out-of-sync with the docs or the API. We could:

Link to a specific tag

Since we already have a release config value, we can automate this like:

- `clock_nvrtc_test.py <https://github.com/NVIDIA/cuda-python/blob/|release|
/cuda_bindings/examples/0_Introduction/clock_nvrtc_test.py>`_

-- though we probably want to do something special in the conf.py to map a "latest" doc build to point to the "main" branch.

Include the files verbatim as pages in the docs

This could be mostly automated.

Ensure examples work across a range of versions

We should fix/augment our CI to make sure all the examples are tested against the range of supported versions. We are kind of there, but not quite.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this to use package-aware refs instead of hardcoding main. latest and preview builds now point at main, while versioned docs point at the matching package tag (cuda-core-v... for core and v... for bindings). I also refreshed the bindings filenames after rebasing onto #1847.

myst-parser = "*"
numpy = "*"
numpydoc = "*"
pip = "*"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I think I mentioned in the earlier PR -- this seems weird / potentially hazardous.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped the pixi docs env/task changes from this PR so it stays scoped to the docs coverage audit. The overlapping docs-workflow work can continue separately.

@cpcloud cpcloud force-pushed the audit-examples-1680 branch from 54127d9 to 286e0fc Compare April 7, 2026 16:06
@cpcloud cpcloud changed the title docs: audit example coverage and add pixi docs builds docs: audit example coverage in published docs Apr 7, 2026
@cpcloud
Copy link
Copy Markdown
Contributor Author

cpcloud commented Apr 7, 2026

Rebased onto current upstream/main, so this branch now includes the #1847 example rename. The follow-up updates in this PR refresh the bindings example references to the new snake_case filenames, make the new example links version-aware, and drop the overlapping pixi workflow changes from this PR.

@cpcloud cpcloud requested a review from mdboom April 7, 2026 16:07
Copy link
Copy Markdown
Contributor

@mdboom mdboom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

cpcloud added 3 commits April 8, 2026 06:52
Make every current cuda.core and cuda.bindings example discoverable from the published docs, and add a reproducible pixi-based docs workflow so documentation changes can be built and debugged locally.

Made-with: Cursor
Point the new example links at package-aware refs instead of always targeting main, and drop the overlapping pixi docs workflow changes so this PR stays scoped to the documentation coverage audit.

Made-with: Cursor
Keep the pixi lockfiles aligned with the current manifests after rebasing onto the merged docs workflow and verifying the docs tasks.

Made-with: Cursor
@cpcloud cpcloud force-pushed the audit-examples-1680 branch from ba5c28b to 659f20b Compare April 8, 2026 11:03
@cpcloud cpcloud enabled auto-merge (squash) April 8, 2026 11:07
@cpcloud cpcloud merged commit f80b085 into NVIDIA:main Apr 8, 2026
87 checks passed
@cpcloud cpcloud deleted the audit-examples-1680 branch April 8, 2026 11:42
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Doc Preview CI
Preview removed because the pull request was closed or merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.bindings Everything related to the cuda.bindings module cuda.core Everything related to the cuda.core module documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Examples: Audit example coverage in documentation

2 participants