-
Notifications
You must be signed in to change notification settings - Fork 9
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
Typehinting extensions proposed may not work #187
Comments
Thanks @GuillemBarroso, it's entirely possible this doesn't work for certain (maybe even the latest) versions of Sphinx and the extensions.. Can you link a We do have a working example of the extensions mentioned in the dev guide in <repo I can send you privately>, I can try and check if that still works with the latest dependencies. |
Hi @greschd, I am waiting for approval, but the PR ansys/pydpf-post#169 seems to be handling the type hints just fine for a small example. The typehint example can be found in Please, let me know if you see any problems with this approach and let's decide what is the best way to handle type hints. |
Thanks for the links @GuillemBarroso. I've tried again with the latest versions of all dependencies, and can confirm the appraoch used in Since that approach seems to work for everyone, I'd suggest we adapt the dev guide to match it. |
I agree with you @greschd . |
Problem with my code, the warning was right. |
See discussion in ansys/pyansys-dev-guide#187 While using `sphinx.ext.autodoc.typehints` worked for us, following the common approach seems superior. Remove the `_autosummary` directory during `make(.bat) clean` in the documentation. This directory is auto-generated, and not removing it can cause a rebuild of the documentation to be incomplete. Use `functools.wraps` for the mapping create method, to get rid of doc build warnings. Loosen and update the dependencies in `pyproject.toml`.
@jorgepiloto I've just noticed this is still outdated. As far as style goes, I think we've settled on
|
Description of the modifications
In dev-guide, three extensions are presented in order to improve the documentation when using type hints.
However, in my case (pydpf-core and pydpf-post) the documentation was failing to build when including these extensions (following the appropriate order) in the conf.py file.
Instead, I've seen that other repos (pymapdl, pyfluent) use a different extension named "sphinx_autodoc_typehints", see their documentation. Note that the documentation states that when using this extension in conjunction with sphinx.ext.napoleon, sphinx.ext.napoleon should be loaded first, before sphinx_autodoc_typehints.
This approach seems to work for pydpf-core and pydpf-post.
Useful links and references
The text was updated successfully, but these errors were encountered: