-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Submodules not showing up for (native) extension modules #319
Comments
Thanks for an exemplary bug report! Just to clarify: Step 5, when we >>> import pyext.submodule
# or
>>> from pyext.submodule import variable Does this run? |
Just tested it:
I think this is because the extension module In other words, I think |
That's exactly why I asked because I remembered resolving to wontfix about a similar issue just recently. See my thoughts in #252 (comment). The simple fact is:
Can you investigate if you can set |
Thank you for the explanation! Unfortunately, setting I respect your decision if you don't want to address this. I'd just like to raise two counter arguments for your consideration. First, I think this issue will probably affect a lot of people (probably all authors of native extension modules that don't find some sort of workaround). Second, I am interpreting the
The reason is that I'm in a python environment where
I agree that |
That's correct. That's why Python has Following related upstream issues:
I think PyO3 might wish to provide a finder akin to the one removed in PyO3/pyo3@8d14568 (briefly discussed in PyO3/pyo3#1269 (comment)), and add it to I'd just hate to have pdoc's deviate from the Python's interpretation of stuff. Then again, we do check in #318 that the object is present in from your_pyext.submodule.nested import Something But that's not really our problem ... 🤔 |
There's apparently a workaround described in PyO3/pyo3#1517 (comment). |
When running
pdoc
on an extension modules (aka, a native "C" extensions), the extension module's submodules don't show up in the documentation even though <TAB>-autocomplete in a Python REPL can find the submodules. This seems to be becausepdoc
searches for submodules by inspecting the source directory, which isn't available for extension modules.I've proposed PR #318 to fix this issue. The proposed solution works but I'm not sure if it is safe enough to remove the old "source directory traversal" method. I'd appreciate guidance on completing the PR.
Expected Behavior
Running
pdoc
on a native extension module should generate documentation for the entire extension module, including its submodules.Actual Behavior
Steps to Reproduce
The following steps generate a minimalistic native extension module in Rust that exhibits the problem. The language shouldn't matter though.
with the following file contents:
Cargo.toml
:src/lib.rs
:cargo build
ln -s target/debug/libpyext.so pyext.so
ln -s target/debug/libpyext.dylib pyext.so
target\debug\libpyext.dll
topyext.pyd
pyext.so
file and verify that the submodule exists and can be found by tab completion:pdoc --html pyext
from the same directory.Additional info
The text was updated successfully, but these errors were encountered: