How to use the stubgen doc-path parameter?

173 views Asked by At

I'm trying to use stubgen to create stubs for the Usd library (https://github.com/PixarAnimationStudios/USD).

I'm able to build the stub-files (.pyi) but i would like to use the docs parameter to get better type information. e.g.

from typing import Any, ClassVar

import Boost.Python
import pxr.Ar
__MFB_FULL_PACKAGE_NAME: str

class DefaultResolver(pxr.Ar.Resolver):
    @classmethod
    def __init__(cls, *args, **kwargs) -> None: ...
    def SetDefaultSearchPath(self, *args, **kwargs) -> Any: ...
    @classmethod
    def __reduce__(cls) -> Any: ...

class DefaultResolverContext(Boost.Python.instance):
    @classmethod
    def __init__(cls, *args, **kwargs) -> None: ...
    @classmethod
    def GetSearchPath(cls, *args, **kwargs) -> Any: ...
    @classmethod
    def __eq__(cls, other) -> Any: ...
    @classmethod
    def __hash__(cls) -> Any: ...
    @classmethod
    def __ne__(cls, other) -> Any: ...
    @classmethod
    def __reduce__(cls) -> Any: ...

...

Unfortunatly i counldn't find to much info/examples about using the --doc-path parameter that is optional for infering better signatures.

When building the docs using doxygen for usd i get the folders doxy_html, doxy_xml and src. The source folder is containing the cpp header files of the library. The doxy_html folder includes the following files: https://graphics.pixar.com/usd/release/api/index.html

I'm try use the mentioned folders with the automatically created docs for the python signatures if possible. In the stubgen docs it says the parameter expects .rst documentation. Can i simply convert the doxy_html to a .rst file? https://mypy.readthedocs.io/en/stable/stubgen.html

0

There are 0 answers