我似乎无法让 Sphinx 从 Nexus 存储库中获取模块

I can't seem to get Sphinx to get modules from a nexus repository

所以我有一个 Python 应用程序,我正在尝试使用 Sphinx 进行记录。我创建了目录结构 运行 sphinx-quickstartsphinx-apidoc,并将我的 config.py 更改为:

sys.path.insert(0, os.path.abspath('../..'))

我的主要问题是这个错误:

$ make html
...
WARNING: autodoc: failed to import module '<module-name>' from module 'app'; the following exception was raised:
No module named 'cfenv'

cfenv 是我们的 pypi 存储库中的一个包,我在应用程序的根目录和具有这些行的 docs/ 目录中都有一个 requirements.txt 文件:

--index-url=<url for the repository>
--extra-index-url=<url for the repository>

应用程序构建和 运行s 没有问题(即,它从 pypi 存储库中提取导入的代码),但文档构建失败。我见过的所有解决方案总是涉及将导入代码的绝对路径放入 config.py,但我有一个 URL,而不是路径名。

如有任何帮助,我们将不胜感激。谢谢!

Python 导入仅适用于文件系统,不适用于 URL。您可以从 URL 安装一个包到您的文件系统,最好是一个虚拟环境,然后 Python 将能够从那里导入包。