The Python testing tool tox
seems to be designed to work with virtualenv. Can it also work on conda/anaconda-based Python installations?
pip is the standard package manager for python, meaning you can use it both inside and outside of Anaconda.
The Earth Engine Python API can be installed to a local machine via conda, a Python package and environment manager. Conda is bundled with Anaconda and Miniconda Python distributions.
Conda treats Python the same as any other package, so it is easy to manage and update multiple installations. Anaconda supports Python 3.7, 3.8, 3.9 and 3.10. The current default is Python 3.9.
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 frompip
.In contrast, when using the
tox-conda
plugintox
will useconda
to create environments, and will install specified dependencies fromconda
. This is useful for developers who rely onconda
for environment management and package distribution but want to take advantage of the features provided bytox
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With