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 docs build warnings and generate API docs with autosummary extension #494

Merged
merged 10 commits into from
Oct 17, 2024

Conversation

yousefmoazzam
Copy link
Collaborator

@yousefmoazzam yousefmoazzam commented Oct 17, 2024

Fixes #468
Fixes #486
Fixes #487
Fixes #490
Doesn't solve #492, but instead finds a workaround via not using | in conjunction with certain types

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have made corresponding changes to the documentation

See #490 for more details.

Maybe there's differences between `autodoc_mock_imports` and
`autosummary_mock_imports`, but for now, `autodoc_mock_imports` seems to
do what is needed, so will carry on using `autodoc_mock_imports` untill
there's a reason to distinguish between the two.
The modules removed are either no longer used in httomo, or are in the
docs environment now, so the mocking of them by sphinx can safely be
removed without any issues.
The YAML checker needs `httomo_backends` purely for getting a path to
the YAML templates at runtime (ie, for functionality), which isn't
needed for just building the docs.
@yousefmoazzam
Copy link
Collaborator Author

All warning in the docs build locally are gone, but the CI has one warning:

/home/runner/work/httomo/httomo/docs/source/developers/api.rst:4: WARNING: autosummary: failed to import httomo.cli.
Possible hints:
* AttributeError: module 'httomo' has no attribute 'cli'
* ImportError: cannot import name '__version__' from 'httomo' (/home/runner/work/httomo/httomo/httomo/__init__.py)
* ImportError: 

Since it appears in CI only and not locally, it may need a bit more time to debug, so I'll make an issue for it to tackle after this PR; it's small in comparison to the main aim of this PR which was to:

  • get rid of as many easily tackle-able warnings in the docs build as possible (ie, get all the low hanging fruit)
  • generate API docs and include them in the main index.rst

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant