Readthedocs - 需要 sphinx 2.1+ 来处理 :async: 选项

Readthedocs - need sphinx 2.1+ to process the :async: option

我的第一个 public Python 项目现在在 readthedocs (RTD) 上。我正在尝试解决一个问题,但到目前为止没有成功。

我正在使用 :async: 选项来标记协程。这是由 sphinx 2.1+ 支持的。 RTD 在我的项目中使用了 sphinx 1.8.5。所有协程都从 HTML 输出中简单地跳过,即根本没有记录。太糟糕了。

我在我的项目中创建了 docs/requirements.txt 文件,其中包含:sphinx>=2.1.0 并且在 RTD > 管理 > 高级设置中我输入了:/docs/requirements.txt as "A pip requirements file needed to build your documentation. Path from the root of your project."。不知道这是否是指定 sphinx 版本的正确方法。反正我试过了。

构建失败:

ERROR: Could not open requirements file: [Errno 2] No such file or directory: '../../../../../../../../docs/requirements.txt'

我怎样才能克服这些问题以正确记录所有协程?

RTD 找不到您的需求文件。尝试通过删除前导斜杠来指定项目根目录的 relative 路径,而不是绝对路径。