sphinx 挂在阅读资源上... [100%] 指数

sphinx hangs on reading sources... [100%] index

我正在使用 Sphinx 来自动记录烧瓶 api。一切似乎都很好,但我有一个非常奇怪的问题。问题可以绕过,但是绕过的并不理想

当我 运行 制作 html 狮身人面像 运行 通过

(env)vagrant@dweloDevEnv:~/make html
sphinx-build -E -a -b html -d _build/doctrees   . _build/html
Running Sphinx v1.3.1
building [mo]: all of 0 po files
building [html]: all source files
updating environment: 1 added, 0 changed, 0 removed
 * Running on http://127.0.0.1:9001/                                            
 * Restarting with reloader
Running Sphinx v1.3.1
building [mo]: all of 0 po files
building [html]: all source files
updating environment: 1 added, 0 changed, 0 removed
reading sources... [100%] index  

在上面一行,sphinx 挂起。我已经离开它整整一分钟,但它不会继续。如果我用 cntrl + c 终止进程,进程实际上似乎成功完成:

reading sources... [100%] index                                                 
^C
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... 
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
doneing output... [100%] index                                                  
writing output... [100%] index                                                  
generating indices... genindex
generating indices... genindex http-routingtable http-routingtable
writing additional pages... search
writing additional pages... search
copying static files... 
copying static files... done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
copying extra files... done
dumping search index in English (code: en) ... done
build succeeded.
done
dumping object inventory... done
build succeeded.

如果我去检查输出目录,我确实找到了 api 的文档。伟大的!不幸的是,这种方法使我无法将进程嵌入 shell 脚本中(因为我必须终止进程才能通过挂起)。我的第一个文件非常简单。我将其包含在下面:

my_app.rst

Contents:

.. toctree::
   :maxdepth: 2
.. autoflask:: my_api.run:api.app
   :undoc-static:
   :blueprints: v1_api
   :include-empty-docstring:

我一直在敲打很长时间,似乎无法弄清楚出了什么问题。缺少任何有用的错误消息并没有使它变得更容易。过去有人遇到过这种情况吗?

问题最终是我实际上是在 my_app.py 文件中执行 api (app.run)。因此,当应用程序对象可用并最终得到解释时,我挂断了,因为 api 正在上线。