Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RTD build #1103

Merged
merged 6 commits into from
Nov 13, 2024
Merged

Fix RTD build #1103

merged 6 commits into from
Nov 13, 2024

Conversation

Yoshanuikabundi
Copy link
Collaborator

Description

RTD builds are succeeding, but with warnings that suggest that API docs are not being generated. I can't reproduce the issue locally so I'm going to poke around here.

Checklist

  • Add tests
  • Lint
  • Update docstrings

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.62%. Comparing base (48a65a6) to head (6c1936c).
Report is 7 commits behind head on main.

Additional details and impacted files

@Yoshanuikabundi
Copy link
Collaborator Author

OK this was unhinged.

Just a note - Sphinx warnings in Interchange mean the documentation is not building correctly. I know Sphinx produces a lot of noise most of the time, but any warnings produced in this repo are real. In this case, the entire API documentation was not building and was absent, so the docs really were badly broken - missing references really should be a hard error.

The error was relating to Autosummary not being able to import the openff.interchange module, so it couldn't produce API docs. The sys.path.insert(0, os.path.abspath("../")) line in docs/conf.py is supposed to tell Sphinx where to find this as by default RTD doesn't install the package in the repo it's building for. I've now configured RTD to install Interchange, and the sys.path.insert line is no longer needed. However, this wasn't the problem.

The problem was that the call to version("openff.interchange") was failing because of a mismatch between the path to the module and the name of the package. VersionInGit was loading the package name from the project.name entry in pyproject.toml, which was Interchange. Importlib then couldn't match that up with the module path openff.interchange. Changing project.name from Interchange to openff-interchange fixed this problem. This also means that Interchange will now show up with the same name whether its installed via pip (eg, in dev installs) or conda. I don't know why things were working everywhere except the docs - I'd guess it has something to do with the fact that conf.py is exec()ed rather than imported.

I've also made some changes to conf.py for a bit more robustness in the face of some changes RTD is making to default configurations.

@Yoshanuikabundi Yoshanuikabundi marked this pull request as ready for review November 13, 2024 02:13
@Yoshanuikabundi Yoshanuikabundi changed the title [DNM] Fix RTD build Fix RTD build Nov 13, 2024
@mattwthompson
Copy link
Member

any warnings produced in this repo are real

Yup, turning it off was intentional since these partial build failures were blocking other development

VersionInGit was loading the package name from

This makes sense! I'm trying to keep human-facing branding as "Interchange" but didn't think of this connection

@mattwthompson mattwthompson merged commit 92f6b9d into main Nov 13, 2024
22 checks passed
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