You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the issues of this repo and believe that this is not a duplicate.
I have searched the documentation and believe that my question is not covered.
Feature Request
Poetry needs to inevitably download some packages(either in sdist or in wheel format) to inspect the dependencies during the dependency resolving phase.
However, due to some reasons, downloading from the official PyPI website is quite slow in my local environment.
Is it possible to utilize a mirror site for the downloading?
I have experimented with a very simple solution.
I add the following function to poetry/repositories/pypi_repository.py, and call it at the very beginning of the function of _get_info_from_wheel and _get_info_from_sdist.
def _get_mirror_url(self, url):
"""
url is normally in the format of https://files.pythonhosted.org/packages/<blahblah>
url of the same package on a mirroring site is
:param url:
:return:
"""
import re
ORIG_URL = "https://files.pythonhosted.org/"
MIRROR_URL = "https://mirrors.cloud.tencent.com/pypi/"
return re.sub(ORIG_URL, MIRROR_URL, url)
Basically, it replaces the default host(pythonhosted.org) with the PyPI mirror host in the URLs.
This dramatically speeds up the dependency resolving(5000+s -> 137s in my local environment).
Do you think it is worth a pull request to add this feature?
BTW, I am wondering where to put the option to let the users specify the mirror site URL for dependency resolving?
The text was updated successfully, but these errors were encountered:
Yes, I was using custom repositories.
According to my observation, for packages that exist in both PyPI and custom repositories, poetry still downloads them from PyPI.
EDIT:
The above problem is fixed in the latest 1.1.4 release.
Feature Request
Poetry needs to inevitably download some packages(either in sdist or in wheel format) to inspect the dependencies during the dependency resolving phase.
However, due to some reasons, downloading from the official PyPI website is quite slow in my local environment.
Is it possible to utilize a mirror site for the downloading?
I have experimented with a very simple solution.
I add the following function to
poetry/repositories/pypi_repository.py
, and call it at the very beginning of the function of_get_info_from_wheel
and_get_info_from_sdist
.Basically, it replaces the default host(
pythonhosted.org
) with the PyPI mirror host in the URLs.This dramatically speeds up the dependency resolving(5000+s -> 137s in my local environment).
Do you think it is worth a pull request to add this feature?
BTW, I am wondering where to put the option to let the users specify the mirror site URL for dependency resolving?
The text was updated successfully, but these errors were encountered: