pypa / bandersnatch

A PyPI mirror client according to PEP 381 http://www.python.org/dev/peps/pep-0381/
Academic Free License v3.0
447 stars 141 forks source link

how to change master in conf to another mirror site #1097

Open itnikita opened 2 years ago

itnikita commented 2 years ago

how to change master to another mirror site

tht default conf is master = https://pypi.org in /etc/bandersnatch.conf

It will download all things index,metadata,package from pypi.org but in my case,it download slowly. I try to change it to another mirror site,it does not work.

Here is a mirror list I try:

 master = https://pypi.org
#master = https://pypi.tuna.tsinghua.edu.cn/simple/
#master = https://pypi.tuna.tsinghua.edu.cn
#master = https://mirrors.aliyun.com
#master = https://pypi.doubanio.com/

the logs is shown bellows partly

  raise ClientConnectorSSLError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorSSLError: Cannot connect to host pypi.tuna.tsinghua.edu.cn:443 ssl:default [[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)]

port status

 nc -vz pypi.tuna.tsinghua.edu.cn 443
Connection to pypi.tuna.tsinghua.edu.cn 443 port [tcp/https] succeeded!

I try:

 pip install --upgrade certifi

It does not work I think the mirror site does not support xmlrpg . So is there a way to download index and metadata from pypi.org,and download packages from mirror site like https://pypi.tuna.tsinghua.edu.cn/simple/ ?

my goal is to download packages from mirror site and download fast.

cooperlees commented 2 years ago

We do support this. Just need to document it better!

download-mirror = https://pypi-mirror.example.com/
download-mirror-no-fallback = False

Example: https://github.com/pypa/bandersnatch/blob/main/src/bandersnatch/default.conf#L90-L102