Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a command-line option to use PyPI mirror during resolving dependcies #3553

Closed
2 tasks done
mnixry opened this issue Jan 8, 2021 · 5 comments
Closed
2 tasks done
Labels
status/duplicate Duplicate issues

Comments

@mnixry
Copy link

mnixry commented Jan 8, 2021

  • 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

In some country such as China, the native PyPI source speed is extremely slow, so most of Chinese users had to choice some mirror of PyPI to alter the default pypi.org settings.

def __init__(self, url="https://pypi.org/", disable_cache=False, fallback=True):
super(PyPiRepository, self).__init__(url.rstrip("/") + "/simple/")
self._base_url = url
self._disable_cache = disable_cache
self._fallback = fallback
release_cache_dir = REPOSITORY_CACHE_DIR / "pypi"
self._cache = CacheManager(
{
"default": "releases",
"serializer": "json",
"stores": {
"releases": {"driver": "file", "path": str(release_cache_dir)},
"packages": {"driver": "dict"},
},
}
)
self._cache_control_cache = FileCache(str(release_cache_dir / "_http"))
self._session = CacheControl(
requests.session(), cache=self._cache_control_cache
)
self._name = "PyPI"

According the code, it's seems possible to change the site domain, but unfortunately this argument is not been used in anywhere.
I hope to add a global option to change the pypi domain instead of add a hard-coded config in pyprojce.toml file, because different mirror speed will be different in different region, I don't think directly submitted to the Git repository and forced all users to use a same mirror is a wise choice.

related: #3552 #3261

@mnixry mnixry added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Jan 8, 2021
@sinoroc
Copy link

sinoroc commented Jan 8, 2021

We should probably close this ticket in favor of #3479 (or maybe there is an other, even more complete ticket).

@sinoroc
Copy link

sinoroc commented May 1, 2021

@mnixry There is a PR that could solve this issue. Would you be able to test it, give feedback? #3624

@dimbleby
Copy link
Contributor

this probably wants absorbing into #6713

@neersighted
Copy link
Member

This is actually a duplicate of #1632 instead. Thanks for spotting it!

@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Oct 23, 2022
@neersighted neersighted added status/duplicate Duplicate issues and removed kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Oct 23, 2022
Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/duplicate Duplicate issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants