Allow setting DIB_PIP_RETRIES
Pip now supports retries on failure. If setting multiple pypi mirrors a fallback will not occure until the failures have finished for the first mirror. This can cause a substantial delay if mirror fallback occurs a lot. Change-Id: Iad37a9015a2d5c861a345a111bd1725b965a42d3
This commit is contained in:
parent
2f4d5be6f3
commit
533896812f
@ -24,10 +24,16 @@ the first mirror to be used, the last listed mirror is used as the pydistutils
|
||||
index. NB: The sort order for these variables is a simple string sort - if you
|
||||
have more than 9 additional mirrors, some care will be needed.
|
||||
|
||||
You can also set the number of retries that occur on failure by setting the
|
||||
DIB\_PIP\_RETRIES environment variable. If setting fallback pip mirrors you
|
||||
typically want to set this to 0 to prevent the need to fail multiple times
|
||||
before falling back.
|
||||
|
||||
A typical use of this element is thus:
|
||||
export DIB\_PYPI\_MIRROR\_URL=http://site/pypi/Ubuntu-13.10
|
||||
export DIB\_PYPI\_MIRROR\_URL\_1=http://site/pypi/
|
||||
export DIB\_PYPI\_MIRROR\_URL\_2=file:///tmp/pypi
|
||||
export DIB\_PIP\_RETRIES=0
|
||||
|
||||
[devpi-server](https://git.openstack.org/cgit/openstack-infra/pypi-mirro://pypi.python.org/pypi/devpi-server)
|
||||
can be useful in making a partial PyPI mirror suitable for building images. For
|
||||
|
@ -44,10 +44,13 @@ def main():
|
||||
use_pypi_python_org = False
|
||||
if use_pypi_python_org:
|
||||
indices.append('https://pypi.python.org/simple')
|
||||
retries = os.environ.get('DIB_PIP_RETRIES')
|
||||
with file(home + '/.pip/pip.conf', 'wt') as output:
|
||||
output.write('[global]\n')
|
||||
output.write('log = %s/pip.log\n' % (home,))
|
||||
output.write('index-url = %s\n' % (indices[0],))
|
||||
if retries is not None:
|
||||
output.write('retries = %s\n' % retries)
|
||||
for index in indices[1:]:
|
||||
output.write('extra-index-url = %s\n' % (index,))
|
||||
with file(home + '/.pydistutils.cfg', 'wt') as output:
|
||||
|
Loading…
Reference in New Issue
Block a user