Espelhos e caches de índice de pacotes#

Status da página:

Incompleta

Última revisão:

2023-11-08

Mirroring or caching of PyPI (and other package indexes) can be used to speed up local package installation, allow offline work, handle corporate firewalls or just plain Internet flakiness.

There are multiple classes of options in this area:

  1. local/hosted caching of package indexes.

  2. local/hosted mirroring of a package index. A mirror is a (whole or partial) copy of a package index, which can be used in place of the original index.

  3. private package index with fall-through to public package indexes (for example, to mitigate dependency confusion attacks), also known as a proxy.

Fazendo cache com pip#

pip fornece uma série de facilidades para acelerar a instalação usando cópias locais em cache de pacotes:

  1. Instalações rápidas e locais baixando todos os requisitos para um projeto e apontando pip para esses arquivos baixados em vez de ir para PyPI.

  2. Uma variação da acima, que pré-constrói os arquivos de instalação para os requisitos usando python3 -m pip wheel:

    python3 -m pip wheel --wheel-dir=/tmp/wheelhouse SomeProject
    python3 -m pip install --no-index --find-links=/tmp/wheelhouse SomeProject
    

Existing projects#

Projeto

Cache

Mirror

Proxy

Notas adicionais

devpi

multiple indexes with inheritance; syncing, replication, fail-over; package upload

bandersnatch

simpleindex

custom plugin enables caching; re-routing to other package indexes

PyPI Cloud

unmaintained; authentication, authorisation

Pulp-python

plugin for Pulp; multiple proxied indexes; package upload

proxpi

multiple proxied indexes

nginx_pypi_cache

multiple proxied indexes

Flask-Pypi-Proxy

unmaintained

Apache

using mod_rewrite and mod_cache_disk, you can cache requests to package indexes through an Apache server