【发布时间】:2017-11-10 14:00:38
【问题描述】:
我有一个 tox 配置,允许我对文档进行一些检查。这或多或少来自official documentation on tox。
[tox]
envlist = py36, flake8, docs
[testenv:docs]
basepython=python3.6
changedir=docs # ← causes sphinx-apidoc to misbehave.
deps=-r{toxinidir}/requirements/requirements.txt
commands=
sphinx-apidoc --force --separate --private --module-first -o docs site '*/*test*' '*/*migration*'
pytest --maxfail=1 --tb=line -v --junitxml=junit_{envname}.xml check_sphinx.py
但是,第一个命令 (sphinx-apidoc …) 需要在项目的根目录中运行,否则排除模式不起作用。尽管我尝试了许多可能的变化。第二个命令需要在docs 目录中运行。
如何让这两个命令在不同的目录中运行?
【问题讨论】:
标签: python python-3.x python-sphinx tox