阅读 setup.py 安装的文档配置

jdk*_*514 6 read-the-docs

我正在尝试自动将项目从 Github 导入到 ReadtheDocs 中。创建文档时由于缺少依赖项而失败。我尝试在配置中添加 setup.py 安装,但遇到以下问题:

  • 您的项目配置有问题。无效的“python.install.0”:.readthedocs.yml:需要“path”或“requirements”键

当前配置yaml:

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
  configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
  version: 3.6
  install:
    - method: setuptools
    - path: .
Run Code Online (Sandbox Code Playgroud)

jdk*_*514 0

我无法找到利用预先存在的 setup.py 文件的答案,但能够使其与 requests.txt 文件一起使用。相关部分是readthedocs.yml文件中python部分的安装部分(如下所示)。

在requirements.txt 文件中,我只是从setup.py 复制了安装要求部分。

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
  configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
  version: 3.6
  install:
    - requirements: docs/requirements.txt
Run Code Online (Sandbox Code Playgroud)