You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Why this PR:**
We already have sphinx generate docs for everything in symforce. The problem, however, is sphinx will only generate docs for `cc_sym.py`, which merely re-exports the contents of `cc_sym.so`, leaving all of the contained classes and functions undocumented.
**The core fix:**
To fix this, nothing needs to be done for `make docs_apidoc`, as that seems to only generate `.rst` files noting that docs need to be generated for `cc_sym`. Instead, I just changed the file extension of `cc_sym.py` so sphinx will ignore it, and then copied in `cc_sym.so` so sphinx will use that module to generate the docs for `cc_sym` instead.
**Note on getting the path of cc_sym.so:**
To find `cc_sym.so`, I used the environment variable `PY_EXTENSION_MODULE_PATH`, and defaulted it to `build/pybind` so it works with the default settings. This is brittle though, as if one wants to change the location where the files are built, the `PY_EXTENSION_MODULE_PATH` won't be updated.
It would better to instead use the cmake variable `SYMFORCE_PY_EXTENSION_MODULE_OUTPUT_PATH`, which is the source of truth for where `cc_sym.so` will get built, or perhaps `symforce.path_util.cc_sym_install_dir()`, which gets its value from the cmake variable, but there isn't an easy way to do that with our handwritten `Makefile` that I know of.
GitOrigin-RevId: 8e7910920d8de6a47af5173ab6e2eb7470bf4579
0 commit comments