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:
local/hosted caching of package indexes.
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.
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:
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.
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 |
---|---|---|---|---|
✔ |
✔ |
multiple indexes with inheritance; syncing, replication, fail-over; package upload |
||
✔ |
✔ |
|||
✔ |
custom plugin enables caching; re-routing to other package indexes |
|||
✔ |
✔ |
unmaintained; authentication, authorisation |
||
✔ |
✔ |
plugin for Pulp; multiple proxied indexes; package upload |
||
✔ |
✔ |
multiple proxied indexes |
||
✔ |
✔ |
multiple proxied indexes |
||
✔ |
✔ |
unmaintained |
||
✔ |
✔ |
using mod_rewrite and mod_cache_disk, you can cache requests to package indexes through an Apache server |