毒物不读setup.cfg

时间:2018-08-19 19:13:37

标签: python setup.py tox

我是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

1 个答案:

答案 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