Lock docs dependencies; build docs with recent Sphinx version #938
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.
I noticed that my local build of the docs was significantly different from the ReadTheDocs one, so I wanted to get them in sync. The Sphinx version RTD was using was really old, 1.8.6. Now we're relatively up to do on 6.2.1 (we can't go to 7.x yet as the sphinx_rtd_theme theme doesn't yet support 7.x).
Using a recent Sphinx produces somewhat nicer docs, particularly in terms of type annotations. Things like
Optional[Union[Foo, Bar]]
becomeFoo | Bar | None
-- much lighter on the eyes. You can view the updated docs here.Per https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html, this updates the .readthedocs.yaml config for the latest format, pins the dependency versions (transitively).
To do the transitive pinning, use a requirements.in (which should be updated by hand) that generates a fully-pinned requirements.txt (which shouldn't be edited). Added the docs/update_requirements.sh script to do this.
Now that we're on a recent Sphinx version, we need to use autodoc_typehints='signature' to avoid the extra empty "Parameters" sections on all classes.