Python / tox将依赖项安装为可编辑的

时间:2015-03-26 16:46:23

标签: python testing tox

tox.ini中,您指定要在其创建的virtualenv中安装tox的软件包。

[testenv]
deps =
    mock
    pytest
commands =
    python setup.py test -q
    python setup.py flake8

此示例告诉tox在运行测试之前将mock和pytest安装到每个virtualenv中。 Tox将使用pip从PyPI安装这些依赖项。

如何从本地结帐而不是从PyPI告诉tox pip install -e一个依赖项?我仍然希望从PyPI安装其余的依赖项。

1 个答案:

答案 0 :(得分:5)

一种方法是从deps变量中删除依赖项,然后运行本地pip install作为tox将在其测试运行中执行的第一个命令。

[testenv]
deps =
    mock
commands =
    pip install -e ~/path/to/pytest
    python setup.py test -q
    python setup.py flake8
相关问题