Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python/tox Install a dependency as editable

In tox.ini, you specify the packages that you want tox to install in the virtualenvs it creates.

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

This example tells tox to install mock and pytest in to each virtualenv before running the tests. Tox will use pip to install those dependencies from PyPI.

How do I tell tox to pip install -e one dependency from a local checkout instead of from PyPI? I still want the rest of the dependencies to be installed from PyPI.

like image 247
Christian Long Avatar asked Mar 26 '15 16:03

Christian Long


1 Answers

One way is to remove the dependency from the deps variable, and just run the local pip install as the first command that tox will execute in its test run.

[testenv]
deps =
    mock
commands =
    pip install -e ~/path/to/pytest
    python setup.py test -q
    python setup.py flake8
like image 124
Christian Long Avatar answered Sep 28 '22 06:09

Christian Long