Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell tox to use PyPI mirrors for installing packages?

Is there a way to tell the tox test automation tool to use the PyPI mirrors while installing all packages (explicit testing dependencies in tox.ini and dependencies from setup.py)?

For example, pip install has a very useful --use-mirrors option that adds mirrors to the list of package servers.

like image 489
Andrey Vlasovskikh Avatar asked May 09 '13 21:05

Andrey Vlasovskikh


People also ask

What is PyPi mirror?

pypi-mirror is a small script to generate a partial PyPI mirror. It relies on pip to do the most difficult part of the job (downloading a package and its dependencies).

Does pip install from PyPi?

Install moduleIt can install packages from the PyPi repository. It's the official repository for python modules. Software you install with pip is downloaded from the PyPi repo and installed.

Where does pip install pull packages from?

By default, pip installs packages located in the Python Package Index (PyPI), but can also install from other indexes.


1 Answers

Since indexserver is deprecated and would be removed and --use-mirrors is deprecated as well, you can use install_command (in your environment section):

[testenv:my_env]
install_command=pip install --index-url=https://my.index-mirror.com --trusted-host=my.index-mirror.com {opts} {packages}
like image 102
Peter K Avatar answered Sep 28 '22 02:09

Peter K