Repository navigation
Fix the docs build by no longer mocking torch - #817
Merged
Merged
Conversation
Read the Docs failed to build the docs for 2.3.0: autosummary could not import schnetpack.atomistic, schnetpack.transform and the other modules. Sphinx replaced torch with a mock, and annotations such as `Callable | nn.Module` or `nn.Module | None`, introduced by the ruff cleanup in #799, raise a TypeError on a mocked nn.Module. The previous `Union[...]` annotations accepted it. torch, pytorch_lightning and torchmetrics are already installed from docs/sphinx-requirements.txt, so the docs now import the real packages. Also set the docs version to 2.3.0 instead of 2.0-dev0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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
Read the Docs fails to build
latestsince the 2.3.0 merge (build 35646079): autosummary cannot importschnetpack.atomistic,schnetpack.transformand the other modules.docs/conf.pymocks torch, and annotations such asCallable | nn.Modulefrom the ruff cleanup (#799) raise aTypeErroron the mockednn.Module.torch, pytorch_lightning and torchmetrics are already installed from
docs/sphinx-requirements.txt, so this setsautodoc_mock_imports = []. It also sets the docs version to 2.3.0 instead of 2.0-dev0. Docs config only; the package is unchanged.Evidence
Local build of
master+ this commit, set up like RTD (Python 3.12,docs/sphinx-requirements.txt, Sphinx 7.1.2,sphinx -T -b html):ImportExceptionGroup: no module named atomistic.Atomwise, the same failure as on RTD.Merge Danger
Door: two-way
Revert the commit to undo it.
Blast Radius: minimal
Only
docs/conf.pychanges. RTD rebuildslatestfrommasterafter the merge.🤖 Generated with Claude Code