Issue with automodule and cython/numpy #12427
Replies: 2 comments
-
Hi @samuelmurail - thanks for the report.
Generally it is the case that when Sphinx builds Python-based documentation, it reads and evaluates the Python code files within the project. So in general, it is necessary for your project's Python code to evaluate successfully, including resolution of module imports, etc. As you've found, there are some options to allow mocking-out individual imports in cases where it isn't desirable to have those installed at doc-build-time. I'm not hugely familiar with |
Beta Was this translation helpful? Give feedback.
-
I'm not certain that this is a bug, so I'm going to remove the label and relocate this thread into the GitHub discussions area until we confirm either that this is in fact a bug, or perhaps figure out a feature request / enhancement proposal from it. |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
Hello everybody,
I am trying to create the automodule section of my library (https://github.com/samuelmurail/pdb_numpy)
But I get this warning, and the automodule docs is not created:
Im my cython library
align_cython.pyx
I have put#cython: embedsignatures=True
andcnp.import_array()
:This error happen when I use
autodoc_mock_imports = ["numpy", "scipy", "pytest"]
If I install
numpy
, and removenumpy
fromautodoc_mock_imports
then the automodule is build.Is it expected to install numpy to build the documentation ?
Should I add numpy to sphinx
requirements.txt
?Cheers,
Thanks for your help.
How to Reproduce
sphinx-build -M html "source" "build"
Environment Information
Sphinx extensions
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions