Add interactive autodoc REPLs via sphinx-pyrepl-web#35
Merged
Conversation
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>
5 tasks
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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/reusesgrill_names-*.whlunder_static/wheels/html_static_path = ['_static']— serves bootstrap scripts and built wheelssphinx-pyrepl-web>=0.4.0from PyPI (released via sphinx-pyrepl-web PR #25)What this enables
Nested API pages (
names/CGAssetFile,DateTimeFile,UsdAsset, …) emit REPLs with:RTD PR previews and local builds document the branch under test without bespoke wheel scripts or RTD hooks.
Test plan
pip install -e ".[docs]"resolvessphinx-pyrepl-web0.4.0 from PyPI:project:sentinel../_static/wheels/grill_names-2.6.2-py3-none-any.whlpaths>>>onnames/CGAssetFile.html