Is it possible to use tox with conda-based Python installations?

The tox-conda plugin should close that gap nowadays, but needs contributors who actively use conda to test and improve it.

from the README:

tox-conda is a plugin that provides integration with the conda package and environment manager for the tox automation tool. It’s like having your cake and eating it, too!

By default, tox creates isolated environments using [virtualenv](https://virtualenv.pypa.io] and installs dependencies from pip.

In contrast, when using the tox-conda plugin tox will use conda to create environments, and will install specified dependencies from conda. This is useful for developers who rely on conda for environment management and package distribution but want to take advantage of the features provided by tox for test automation.

To install that plugin it needs to be installed alongside tox in the same virutal environment. To create a virtual environment containing tox and tox-conda this should suffice:

$ python3 -m venv toxbase
$ toxbase/bin/pip install tox tox-conda
[...]
Successfully installed tox-3.13.2 tox-conda-0.2.0
$ toxbase/bin/tox --version
3.13.1 imported from /home/ob/tmp/toxbase/lib/python3.6/site-packages/tox/__init__.py
registered plugins:
    tox-conda-0.2.0 at /home/ob/tmp/toxbase/lib/python3.6/site-packages/tox_conda/plugin.py

from then on tox can be used as a command line tool and kept current by upgrading it in the toxbase virtualenv. Another, more automated way would be to use pipx

Leave a Comment