-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Labels
component: documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request
Description
Automate the generation of stub files with CI tools.
Sphinx
- https://pybind11.readthedocs.io/en/stable/advanced/misc.html#generating-documentation-using-sphinx
- Use PEP 484 stub files when documenting native extensions with autodoc sphinx-doc/sphinx#7630
- https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_docstring_signature
Automation
- https://github.com/marketplace/actions/add-commit
- https://github.com/stefanzweifel/git-auto-commit-action
Generators
pybind11-stubgen
https://github.com/sizmailov/pybind11-stubgen
pybind11-stubgen amrex
pybind11-stubgen amrex.space1d
pybind11-stubgen amrex.space2d
pybind11-stubgen amrex.space3dCreates files in stubs/. Does not automatically go recursive?
Pro:
- doc strings preserved!
Cons:
- Quote sensitive, errors on encountered C++ types in signatures (for non-bound types?).
--ignore-all-errorshelps.- actually a good diagnostics to fix unbound types and init-order issues.
MyPy
https://mypy.readthedocs.io/en/stable/stubgen.html
https://github.com/MikePopoloski/pyslang/issues/96
stubgen -p amrex
stubgen -p amrex.space2d
stubgen -p amrex.space3dProcessed 5 modules
Generated files under out/amrex/
Pro:
- no errors
Con:
- no doc strings [FEAT] Generate docstrings that are compatible with Sphinx and stubgen pybind/pybind11#2619
nanobind-stubgen
After #127 -> https://github.com/cansik/nanobind-stubgen
- nanobind-stubgen - Generate python stub files for code completion wjakob/nanobind#163
- Generate documentation and stub file for nanobind Python module wjakob/nanobind#171
Other
Metadata
Metadata
Assignees
Labels
component: documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request