Skip to content

Add interactive autodoc REPLs via sphinx-pyrepl-web#35

Merged
chrizzFTD merged 7 commits into
mainfrom
cursor/sphinx-pyrepl-web-3a94
Jul 7, 2026
Merged

Add interactive autodoc REPLs via sphinx-pyrepl-web#35
chrizzFTD merged 7 commits into
mainfrom
cursor/sphinx-pyrepl-web-3a94

Conversation

@chrizzFTD

@chrizzFTD chrizzFTD commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Integrates interactive Python REPLs in grill-names docs via sphinx-pyrepl-web, using the :project: sentinel so autodoc doctest REPLs install the in-tree package wheel at build time.

Changes

  • pyrepl_doctest_blocks = "autodoc"
  • pyrepl_autodoc_packages = ":project:" — extension builds/reuses grill_names-*.whl under _static/wheels/
  • html_static_path = ['_static'] — serves bootstrap scripts and built wheels
  • sphinx-pyrepl-web>=0.4.0 from PyPI (released via sphinx-pyrepl-web PR #25)

What this enables

Nested API pages (names/CGAssetFile, DateTimeFile, UsdAsset, …) emit REPLs with:

packages="../_static/wheels/grill_names-2.6.2-py3-none-any.whl"

RTD PR previews and local builds document the branch under test without bespoke wheel scripts or RTD hooks.

Test plan

  • pip install -e ".[docs]" resolves sphinx-pyrepl-web 0.4.0 from PyPI
  • Clean docs build auto-builds wheel via :project: sentinel
  • Nested pages emit correct ../_static/wheels/grill_names-2.6.2-py3-none-any.whl paths
  • RTD preview: interactive >>> on names/CGAssetFile.html
Open in Web Open in Cursor 

cursoragent and others added 5 commits July 1, 2026 13:53
Enable pyrepl_doctest_blocks for autodoc docstring examples and configure
pyrepl_autodoc_packages for grill-names and naming in the browser REPL.

Pin sphinx>=9 and install sphinx-pyrepl-web from the upstream PR #18 branch
(cursor/autodoc-import-bootstrap-d63f), which auto-generates bootstrap imports
for bare doctest names.

Co-authored-by: chrizzftd <chrizzFTD@users.noreply.github.com>
Point pyrepl_autodoc_packages at _static/wheels/grill-names.whl so the
browser REPL installs the branch-built wheel (with naming resolved from
wheel metadata) instead of declaring PyPI package names in conf.py.

Add scripts/build_docs_wheel.py and invoke it from build_docs.py and
RTD post_install before Sphinx runs.

Co-authored-by: chrizzftd <chrizzFTD@users.noreply.github.com>
sphinx-pyrepl-web emits _static/ URLs that browsers resolve relative to
the current page. On names/*.html that resolves to names/_static/...,
which 404s on RTD and leaves the REPL blank.

Prefix paths with ../ per directory depth in doctree-resolved.

Co-authored-by: chrizzftd <chrizzFTD@users.noreply.github.com>
micropip rejects wheel URLs whose final path segment is not a valid
PEP 427 name. The stable alias grill-names.whl caused install to fail
after the nested-page path fix, leaving an empty terminal with no >>>.

Keep the pip-built grill_names-*-py3-none-any.whl name and resolve it
from conf.py at build time.

Co-authored-by: chrizzftd <chrizzFTD@users.noreply.github.com>
Pin cursor/autodoc-bootstrap-src-only-16b5, which includes upstream
_asset_href normalization via Sphinx relative_uri (#20). Remove the
local doctree-resolved hook now that nested pages get correct paths
from the extension.

Co-authored-by: chrizzftd <chrizzFTD@users.noreply.github.com>
Match naming PR #32: pin sphinx-pyrepl-web 0.4.0 branch and set
pyrepl_autodoc_packages = ":project:" so the extension builds the
in-tree grill-names wheel at doc-build time.

Remove scripts/build_docs_wheel.py, RTD post_install, and the conf.py
wheel path glob — no longer needed after sphinx-pyrepl-web PR #25.

Co-authored-by: chrizzftd <chrizzFTD@users.noreply.github.com>
@chrizzFTD chrizzFTD changed the base branch from main to develop July 7, 2026 12:06
@chrizzFTD chrizzFTD changed the base branch from develop to main July 7, 2026 12:08
Replace git branch pin now that PR #25 is released with the :project:
sentinel for autodoc REPL wheels.

Co-authored-by: chrizzftd <chrizzFTD@users.noreply.github.com>
@chrizzFTD chrizzFTD marked this pull request as ready for review July 7, 2026 13:12
@thegrill thegrill deleted a comment from cursor Bot Jul 7, 2026
@chrizzFTD chrizzFTD merged commit bfe18f4 into main Jul 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants