【发布时间】:2020-10-11 23:19:24
【问题描述】:
我有一个主要是 Python 的大型项目,我正在尝试记录它。该项目的一部分依赖于可通过 Cython 访问的 C++ 源代码。
正常运行代码时,它运行良好,但在尝试使用 Sphinx 进行自动记录时,我遇到了问题。我认为this guy 的想法是正确的,但我无法实现。
我的Makefile 看起来像这样
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
如何让 Sphinx 运行 python setup.py build_ext --inplace,然后在分析代码之前引用输出 .so 文件?
感谢您的宝贵时间。
【问题讨论】:
标签: c++ makefile cython python-sphinx