Fix missing Autodoc rendered result on Read the Docs#23
Merged
Conversation
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>
Documentation build overview
|
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.
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 includedpyrepl_test_pkgin the[docs]extra so Sphinx could import the module at build time:Commit
33a4ea7correctly removed that local path dependency so the package could be published to PyPI (PyPI rejectsfile:URLs in optional extras). However,.readthedocs.ymlwas not updated — RTD still only runs:pip install .[docs]Without
pyrepl_test_pkginstalled, autodoc fails to import the documented object:The
.. autofunction:: pyrepl_test_pkg.demo.example_generatordirective indocs/example.rstthen renders nothing. The committed wheel underdocs/_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: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/_buildexample_generatorand<py-repl>widgets present in built HTMLOptional follow-ups (out of scope for this PR)
pre_buildstep runningscripts/build_test_pkg_wheel.pyif the fixture source changes without updating the committed wheel