我是python的新手,并且对tox有一些问题。
我的tox.ini
[tox]
envlist = py36
[testenv]
passenv = TOXENV CI TRAVIS TRAVIS_*
usedevelop = True
install_command = pip install -U {opts} {packages}
deps = -r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
commands =
python -V
py.test -vvv -s
[testenv:docs]
commands =
python setup.py build_sphinx
我的setup.cfg
[build_sphinx]
source-dir = docs/source
build-dir = docs/build
all_files = 1
[upload_sphinx]
upload-dir = docs/build/html
python setup.py build_sphinx
很好,但是/Users/ben/development/python/test/.tox/docs/bin/python setup.py build_sphinx
说
错误:命令'build_sphinx'无效
我的环境
$ python --version
Python 3.6.0
$ /Users/ben/development/python/test/.tox/docs/bin/python --version
Python 3.6.0
答案 0 :(得分:3)
您需要安装sphinx
作为依赖项的一部分,才能使用build_sphinx
setuptools / distutils命令。
例如:
[testenv:docs]
deps =
# you may also need {[testenv]deps} here if you depend on the
# parent deps
sphinx
commands =
python setup.py build_sphinx