python - 具有相同结构的多个模块的 Python Sphinx
问题描述
我有一个文件夹结构:
folder
foo
src
__init__.py
folder1
__init__.py
fileA.py
fileB.py
bar
src
__init__.py
folder1
__init__.py
fileA.py
fileB.py
在 fileA 的代码中,我导入了类似的内容:
from src.folder1.fileA import something
当我尝试记录这些文件时,未导入其中一个模块。
在conf.py
:
sys.path.insert(0, os.path.abspath('../../folder/foo/'))
sys.path.insert(1, os.path.abspath('../../folder/bar/'))
在 HTML 页面中显示某些内容的唯一方法是使用:
.. automodule:: src.folder1.fileB
但是当我运行 make 时,只有一个函数的描述会同时显示给 html 页面中的 foo 和 bar 。
是否对文档进行任何更改以不更改代码中的导入?
解决方案
推荐阅读
- android - 如何创建这种类型的布局
- javascript - 为 Gcloud AutoML Vision API 验证 Javascript 程序
- mysql - MYSQL - 从每个不同的 id 获取最后一个结果
- gradle - 如何从 Gradle 调用 sbt 任务?
- javascript - 在 d3.js 中制作条形图。如何将单个对象中的值放入一个栏中?
- swift - 单元测试 - 未在构建设置中显示 TEST_TARGET_NAME
- jquery - 在点击事件上压缩 jQuery
- typescript - 导入默认命名空间 - 为什么我得到“未定义”?
- python - python的小数点
- admin-on-rest - (我可以)使用“admin-on-rest/lib/util/HttpError”中的“HttpError”是否安全?