Local wheels, config-driven autodoc REPLs, and pyrepl-web re-vendor#16
Conversation
Stop falling back to packages= for installed modules in _resolve_autodoc_bootstrap. In-tree modules still get silent :src: bootstrap; out-of-tree modules replay doctest input only until explicit wheel paths are configured in a follow-up. Co-authored-by: chrizzftd <chrizzFTD@users.noreply.github.com>
Documentation build overview
|
- Add wheel fixture and tests/test_local_wheel.py (doctree, full build, packages+src+replay, comma-separated packages) - Document local Pyodide wheel workflow in README and docs/example.rst - Set html_static_path in docs/conf.py so wheels are copied to output - Re-vendor pyrepl-web from cursor/resolve-package-urls-0bbd (PR #5) for runtime relative wheel URL resolution Co-authored-by: chrizzftd <chrizzFTD@users.noreply.github.com>
Vendor cursor/resolve-package-urls-0bbd@1d95c619, which is rebased onto grill with replay mode (#4) and relative wheel URL resolution. Restores replay-src runtime support that was lost in the earlier pre-rebase vendor. Co-authored-by: chrizzftd <chrizzFTD@users.noreply.github.com>
* Config-driven autodoc packages via wheel path Replace module introspection and silent :src: bootstrap for autodoc REPLs with a single pyrepl_autodoc_packages config value. Remove pyrepl_autodoc_bootstrap. --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: chrizzftd <chrizzFTD@users.noreply.github.com>
|
@cursoragent review |
PR Review: #16 — Local wheels, config-driven autodoc REPLs, and pyrepl-web re-vendorVerdict: Approve. This is a solid, cohesive delivery of Phase 0 plus the planned autodoc wheel workflow. RTD preview built successfully; 31 tests pass locally. What works wellArchitecture. Replacing module introspection with Clean separation of concerns.
Extension code is lean. Test coverage is strong for the behaviors that matter:
Vendored JS is correct. Docs/tooling. README, Issues / nits (non-blocking)1. Upstream dependency: pyrepl-web PR #5 still open Assets are vendored from 2. Wheel must match the documented package
3. Known bootstrap limitations (document, don't block)
These are inherent limits of metadata-only import guessing, not regressions. 4. Nested page paths not normalized
5. .. literalinclude:: ../../tests/fixtures/pyrepl_test_pkg/pyrepl_test_pkg/demo.pyWorks on RTD; slightly unusual for published docs. Acceptable for a maintainer-facing example site. 6. Path dependency in 7. Bootstrap files written inside replay loop raw_bootstrap = metadata.get(BOOTSTRAP_FILES_KEY)
if raw_bootstrap:
bootstrap_files = json.loads(raw_bootstrap)
for name, content in bootstrap_files.items():
(replay_dest / name).write_text(content, encoding="utf-8")Bootstrap copy only runs when replay files exist for that docname. Always true today since they're registered together, but a separate loop would be more robust. Low priority. 8. Minor test gaps
Breaking change (document on merge to
|
| Step | Status |
|---|---|
pytest (31 passed) |
✓ |
| RTD preview build | ✓ |
| pyrepl-web #5 merged (or vendor SHA updated) | pending upstream |
Manual: autodoc REPL loads wheel + runs example_generator doctest |
open |
Release note for pyrepl_autodoc_bootstrap removal |
recommended |
Summary
| Area | Rating |
|---|---|
| Correctness (stated goals) | ✅ |
| Scope / complexity | ✅ |
| Tests | ✅ |
| Docs | ✅ |
| Upstream coupling | |
| Runtime edge cases |
Recommendation: merge once pyrepl-web #5 lands (or accept vendoring from the PR branch with a tracked follow-up to re-vendor from grill). The design is cleaner than the original introspection approach, Phase 0 is complete, and the combined #17+#18 autodoc story is coherent. Only remaining gate is the manual RTD preview check on the live autodoc REPL example.
* Normalize emitted asset paths for nested Sphinx pages Rewrite file-like paths in py-repl attributes to page-relative URLs using Sphinx get_target_uri and relative_uri. This fixes REPL asset loading on nested doc pages while preserving flat-layout behavior and compatibility with RTD-style path prefixes. Adds asset_href helpers, unit tests, a nested-page build fixture, and README documentation. Closes #19. --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: chrizzftd <chrizzFTD@users.noreply.github.com>
|
@cursoragent review |
PR Review: #16 (current) — Local wheels, config-driven autodoc REPLs, and pyrepl-web re-vendorVerdict: Approve. Since the last review, two meaningful commits landed (#20 path normalization, #21 test refactor). RTD preview built on What's new since the last review1. Nested page paths — fixed (#20) The earlier nit about def _asset_href(builder: Builder, docname: str, path: str) -> str:
"""Rewrite a file path for the HTML page that will emit it."""
if not _is_file_like_path(path):
return path
if builder.format != "html":
return path
return relative_uri(builder.get_target_uri(docname), path)
This is the right approach — idiomatic Sphinx, works with pyrepl-web's 2. Test suite refactor (#21) Tests are now layered:
Shared helpers in What still works wellArchitecture — Vendored JS — Still includes both Docs — README now documents page-relative path rewriting (line 66). RTD preview succeeds. Breaking change — Remaining nits (non-blocking)1. PR description is stale The body still shows un-normalized paths in the example: <py-repl src="_static/pyrepl/example-1-bootstrap.py"
packages="_static/wheels/...">And doesn't mention #20 or #21. Worth updating before merge so reviewers aren't misled. On a nested page the emitted attrs would be 2. Upstream: pyrepl-web #5 still open Vendor SHA 3. Wheel must match documented package Still worth a README note: 4. Bootstrap limitations (inherent, document if not already)
5. Bootstrap copy still nested under replay loop raw_bootstrap = metadata.get(BOOTSTRAP_FILES_KEY)
if raw_bootstrap:
bootstrap_files = json.loads(raw_bootstrap)
for name, content in bootstrap_files.items():
(replay_dest / name).write_text(content, encoding="utf-8")Always true today; separate loop would be more robust. Low priority. 6. Path dependency — documented, acceptable. 7. Unusual for published docs but works on RTD. Resolved since prior review
Merge checklist
Summary
Recommendation: merge. The branch is in better shape than at the last review — nested paths and test coverage are both addressed. Only gates left are manual RTD REPL verification, syncing the PR description, and ideally landing pyrepl-web #5 alongside. |
Signed-off-by: Christian López Barrón <chris.gfz@gmail.com>
Signed-off-by: Christian López Barrón <chris.gfz@gmail.com>
Signed-off-by: Christian López Barrón <chris.gfz@gmail.com>
Signed-off-by: Christian López Barrón <chris.gfz@gmail.com>
Signed-off-by: Christian López Barrón <chris.gfz@gmail.com>
Signed-off-by: Christian López Barrón <chris.gfz@gmail.com>
Signed-off-by: Christian López Barrón <chris.gfz@gmail.com>
Breaking changes since 0.2.0: pyrepl_autodoc_bootstrap removed in favor of pyrepl_autodoc_packages; :silent: directive option removed. Co-authored-by: chrizzftd <chrizzFTD@users.noreply.github.com>
Signed-off-by: Christian López Barrón <chris.gfz@gmail.com>


Summary
Delivers branch-aware autodoc doctest REPLs via local Pyodide wheels, replacing module introspection with explicit configuration. Stacks Phase 0 (#14) with follow-on work from #17, #18, #20, and #21.
Release:
0.3.0Changes
pyrepl-web vendor
cursor/resolve-package-urls-0bbd@1d95c619)replay-src) and relative wheel URL resolution formicropip.install()Phase 0 — local Pyodide wheels (#14)
html_static_path = ["_static"]indocs/conf.pyscripts/build_test_pkg_wheel.pyto rebuild/copy the committed fixture wheelAutodoc REPL configuration (#17)
pyrepl_autodoc_bootstrapand module introspection (importlib/inspect)pyrepl_autodoc_packages— single config knob for autodoc package preload (wheel path or PyPI name)pyrepl_test_pkg;[docs]extra installs the fixture forpip install -e ".[docs]"Auto-import bootstrap (#18)
pyrepl_autodoc_packagesis set, generate a silentsrc=bootstrap script from autodoc metadata_static/pyrepl/{docname}-{n}-bootstrap.pyNested page paths (#20)
_static/...paths to page-relative URLs via Sphinxrelative_uri(e.g.../_static/wheels/foo.whlon nested pages)Test suite (#21)
unit//doctree//integration/tests with shared fixturesAutodoc behavior
pyrepl_autodoc_packagesNone/""packages=install → silent import bootstrap → interactive replayBreaking changes (0.2.0 → 0.3.0)
pyrepl_autodoc_bootstrapremoved (usepyrepl_autodoc_packagesinstead):silent:directive option removedTest plan
pytest— 46 passedsphinx-builddocs — passedpython -m build+twine check dist/*— passedpyrepl_test_pkgfrom wheel and runs doctest replay