Skip to content

Install mcpy on the docs builder - #33

Merged
farrisric merged 1 commit into
mainfrom
fix/rtd-autodoc-install
Aug 24, 2026
Merged

farrisric merged 1 commit into
mainfrom
fix/rtd-autodoc-install

Conversation

@farrisric

Copy link
Copy Markdown
Owner

#32 switched the API reference to sphinx.ext.autodoc, which imports mcpy.
Read the Docs installs only docs/requirements.txt (the theme), so on the docs
builder every autodoc directive fails to import and the whole reference builds
empty. fail_on_warning is off, so nothing catches it.

Reproduced in a clean env with sphinx + the RTD theme and no mcpy:

WARNING: autodoc: failed to import class 'ensembles.grand_canonical_ensemble.GrandCanonicalEnsemble' from module 'mcpy'
... one per documented class, across all five reference pages

This installs the package into the docs environment and moves the builder to
Python 3.12 - the move signatures use PEP 604 unions, which the pinned 3.9
cannot parse. The optional GPU backends stay uninstalled; docs/conf.py
already mocks torch, mace, nvalchemi, cuequivariance and mpi4py.

After the change, the same clean env builds with no warnings and the reference
pages carry their classes again.

The API reference switched to autodoc, which imports mcpy, but Read the Docs
installs only docs/requirements.txt. Every autodoc directive therefore failed
to import and the whole reference built empty, with warnings that nothing
gated on (fail_on_warning is off).

Adds the package to the docs environment and moves the builder to Python 3.12:
the move signatures use PEP 604 unions, which 3.9 cannot even parse. The
optional GPU backends stay out; conf.py already mocks torch, mace, nvalchemi,
cuequivariance and mpi4py.

Verified in a clean env with only sphinx, the RTD theme and mcpy installed:
the build now emits no warnings and the reference pages carry their classes.
@farrisric
farrisric merged commit 26c4e56 into main Aug 24, 2026
4 checks passed
@farrisric
farrisric deleted the fix/rtd-autodoc-install branch August 24, 2026 13:43
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.

1 participant