-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Pdoc Does Not Pick Up PyO3/pybind11 Submodules #633
Comments
Thanks! The problem is not so much the pyi file, but the fact that we don't pick up the submodule: $ pdoc opendal.layers -o .render
Warn: Cannot find spec for opendal.layers (from opendal.layers):
Traceback (most recent call last):
File "/Users/user/git/pdoc/pdoc/extract.py", line 62, in walk_specs
raise ModuleNotFoundError(modname)
ModuleNotFoundError: opendal.layers
(/Users/user/git/pdoc/pdoc/__init__.py:506)
Traceback (most recent call last):
File "/Users/user/git/pdoc/venv/bin/pdoc", line 8, in <module>
sys.exit(cli())
^^^^^
File "/Users/user/git/pdoc/pdoc/__main__.py", line 199, in cli
pdoc.pdoc(
File "/Users/user/git/pdoc/pdoc/__init__.py", line 506, in pdoc
for module_name in extract.walk_specs(modules):
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/user/git/pdoc/pdoc/extract.py", line 85, in walk_specs
raise ValueError(
ValueError: No modules found matching spec: opendal.layers $ pdoc opendal opendal.layers -o .render
Warn: Cannot find spec for opendal.layers (from opendal.layers):
Traceback (most recent call last):
File "/Users/user/git/pdoc/pdoc/extract.py", line 60, in walk_specs
modspec = importlib.util.find_spec(modname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib.util>", line 114, in find_spec
ValueError: opendal.layers.__spec__ is None
(/Users/user/git/pdoc/pdoc/__init__.py:506) Gotta figure out how we solve this one. :) |
They use a workaround to allow importing a submodule directly which might be relevant: |
I've got the similar issue with empty |
This is super helpful, thanks @evguran! 🍰 |
Minimal repro: https://github.com/mitmproxy/pdoc-pyo3-sample-library |
.pyi
stub submodules is missing
I have a candidate PR to fix this over at #643. Could you folks test that and report back if it fixes your issues? 😃 pip install git+https://github.com/mhils/pdoc@pyo3-submodules (cc @MarquessV who may not be subscribed but linked this issue a few days ago) |
Problem Description
Documentation for
.pyi
files is only generated for__init__.pyi
. If a package includes other*.pyi
files, then they are ignored.Steps to reproduce the behavior:
opendal
includeslayers.pyi
which is shown here, but the submodule isn't displayed in docs.ls ~/.local/lib/python3.10/site-packages/opendal __init__.py __init__.pyi layers.pyi _opendal.abi3.so __pycache__
System Information
pdoc: 14.1.0
Python: 3.10.8
Platform: Linux-6.1.31-2-MANJARO-x86_64-with-glibc2.38
The text was updated successfully, but these errors were encountered: