How can I tell readthedocs not to load any Python files located at top root folder?
Background: I would like readthedocs to build Sphinx documentation for a Blender Python add-on, hosted on github. I have created docs folder in the repository for Sphinx files. I can build Sphinx docs OK on my local computer (in docs directory), but the build on readthedocs fails on error
File "/home/docs/checkouts/readthedocs.org/user_builds/bvtknodes/envs/latest/lib/python3.7/site-packages/pip/_internal/utils/misc.py", line 20, in <module>
from pip._vendor import pkg_resources
File "/home/docs/checkouts/readthedocs.org/user_builds/bvtknodes/envs/latest/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 41, in <module>
import inspect
File "/home/docs/checkouts/readthedocs.org/user_builds/bvtknodes/checkouts/latest/inspect.py", line 1, in <module>
import bpy
ModuleNotFoundError: No module named 'bpy'
The reason for this error was that there was inspect.py
module located at root directory, so readthedocs setup process loaded that instead of system version of inspect module. When I renamed my inspect.py to b_inspect.py, then the docs building process finished properly at readthedocs. However this is just a workaround, is there a better solution?
Original wrong interpretation: It seems that readthedocs is trying to inspect __init__.py
(located at top folder level and can't be moved from there to a subfolder) contents and build fails when it can't import bpy
. AFAIK there is no way to install bpy module via pip (but I wouldn't want to do that anyway). I'd like readthedocs to ignore all python files. language = None
and extensions
list in docs/conf.py
is empty. I've also set "Python configuration file" setting in readthedocs Advanced Settings to docs/conf.py
. Thanks!