Skip to content

Fix missing Autodoc rendered result on Read the Docs#23

Merged
chrizzFTD merged 1 commit into
mainfrom
cursor/fix-rtd-autodoc-missing-a19e
Jul 5, 2026
Merged

Fix missing Autodoc rendered result on Read the Docs#23
chrizzFTD merged 1 commit into
mainfrom
cursor/fix-rtd-autodoc-missing-a19e

Conversation

@chrizzFTD

Copy link
Copy Markdown
Owner

Problem

The Autodoc section on the live docs site shows an empty "Rendered result:" block — no function signature, docstring, or interactive REPL.

Root cause

PR #16 (5b9fcee) added autodoc integration and included pyrepl_test_pkg in the [docs] extra so Sphinx could import the module at build time:

docs = [
    "myst-parser",
    "pyrepl_test_pkg @ file:./tests/fixtures/pyrepl_test_pkg",
]

Commit 33a4ea7 correctly removed that local path dependency so the package could be published to PyPI (PyPI rejects file: URLs in optional extras). However, .readthedocs.yml was not updated — RTD still only runs:

pip install .[docs]

Without pyrepl_test_pkg installed, autodoc fails to import the documented object:

WARNING: autodoc: failed to import 'demo.example_generator' from module 'pyrepl_test_pkg'
ModuleNotFoundError: No module named 'pyrepl_test_pkg'

The .. autofunction:: pyrepl_test_pkg.demo.example_generator directive in docs/example.rst then renders nothing. The committed wheel under docs/_static/wheels/ is fine; the build-time import is what was missing.

Fix

Install the fixture package separately on Read the Docs, matching the local dev instructions already in docs/development.rst:

- method: pip
  path: tests/fixtures/pyrepl_test_pkg

Verification

Simulated the RTD install locally:

pip install -e ".[docs]"
pip install -e tests/fixtures/pyrepl_test_pkg
python -m sphinx -b html docs docs/_build
  • No autodoc import warnings
  • example_generator and <py-repl> widgets present in built HTML

Optional follow-ups (out of scope for this PR)

  • Add a CI job that builds docs with the same install steps to catch this class of regression
  • Consider an RTD pre_build step running scripts/build_test_pkg_wheel.py if the fixture source changes without updating the committed wheel
Open in Web Open in Cursor 

Commit 33a4ea7 removed the local path dependency from the [docs] extra
so the package could be published to PyPI, but RTD was still only running
pip install .[docs]. Without pyrepl_test_pkg importable at build time,
.. autofunction:: pyrepl_test_pkg.demo.example_generator renders nothing.

Co-authored-by: chrizzftd <chrizzFTD@users.noreply.github.com>
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 sphinx-pyrepl-web | 🛠️ Build #33450648 | 📁 Comparing 0f1c249 against latest (33a4ea7)

  🔍 Preview build  

2 files changed
± genindex.html
± index.html

@chrizzFTD chrizzFTD merged commit df1315a into main Jul 5, 2026
4 checks passed
@chrizzFTD chrizzFTD deleted the cursor/fix-rtd-autodoc-missing-a19e branch July 5, 2026 22:04
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