Skip to content

Commit 80c9fb3

Browse files
committed
Add type hint stubs and generate documentation from them
I've been wanting to add type hints for the _drgn C extension for awhile. The main blocker was that there is a large overlap between the documentation (in docs/api_reference.rst) and the stub file, and I really didn't want to duplicate the information. Therefore, it was a requirement that the the documentation could be generated from the stub file, or vice versa. Unfortunately, none of the existing tools that I could find supported this very well. So, I bit the bullet and wrote my own Sphinx extension that uses the stub file as the source of truth (and subsumes my old autopackage extension and gen_docstrings script). The stub file is probably incomplete/inaccurate in places, but this should be a good starting point to improve on. Closes #22.
1 parent 1b7e683 commit 80c9fb3

22 files changed

+3002
-1763
lines changed

.readthedocs.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
version: 2
22
sphinx:
33
configuration: docs/conf.py
4-
python:
5-
install:
6-
- requirements: docs/requirements.txt

0 commit comments

Comments
 (0)