Reputation: 1183
I'm new to python and have some problems with tox.
My 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
My 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
works just fine, but /Users/ben/development/python/test/.tox/docs/bin/python setup.py build_sphinx
says
error: invalid command 'build_sphinx'
My environment
$ python --version
Python 3.6.0
$ /Users/ben/development/python/test/.tox/docs/bin/python --version
Python 3.6.0
Upvotes: 1
Views: 1733
Reputation: 69972
You need to install sphinx
as part of your dependencies in order to use the build_sphinx
setuptools/distutils command.
For instance:
[testenv:docs]
deps =
# you may also need {[testenv]deps} here if you depend on the
# parent deps
sphinx
commands =
python setup.py build_sphinx
Upvotes: 3