-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
--pypi-mirror not applied during virtualenv creation #2455
Comments
I've started working on the fix for this and hope to have it available for review by tomorrow. I intend to set the PIP_INDEX_URL environment variable to the value of --pypi-mirror when calling virtualenv in do_create_virtualenv. This was not detected during prior testing, as pip/virtualenv will silently fail if connections to pypi fail. However, pip will hang (which will cause pipenv to time out) if connections to pypi hang. |
Thanks for digging into this. Do you want to tackle it? Is it a good idea to handle the exception(s)? -- are there any? If not, should we temporarily set the default pip index while we create the environment? (I see after typing this that you like the second option, which sounds fine to me) |
Yeah, I'll tackle it. I see two options:
I think 2 is probably more consistent with what the user would expect. |
I'm marking our (immediate) bugfix release as 7.0, but really we are gonna get it released whenever we can. If this is done whenever that is done, we will include it in the bugfix release. If not, no pressure, we can get this in on the next cycle |
Adds support for the --pypi-mirror parameter for all operations which may result in a virtualenv initialization. When a virtualenv is initialized, pip attempts to download several dependencies from PyPI. If PyPI is unavailable, virtualenv silently uses local packages instead, which is acceptable in most cases. However, in some environments connection attempts to PyPI will stall rather than fail, causing a pipenv timeout. By using the mirror specified by --pypi-mirror, we can ensure virtualenv will attempt to download dependencies from an accessible mirror instead of PyPI. - Fixes pypa#2455
Adds support for the --pypi-mirror parameter for all operations which may result in a virtualenv initialization. When a virtualenv is initialized, pip attempts to download several dependencies from PyPI. If PyPI is unavailable, virtualenv silently uses local packages instead, which is acceptable in most cases. However, in some environments connection attempts to PyPI will stall rather than fail, causing a pipenv timeout. By using the mirror specified by --pypi-mirror, we can ensure virtualenv will attempt to download dependencies from an accessible mirror instead of PyPI. - Fixes pypa#2455
When starting a new project using pipenv with --pypi-mirror specified, virtualenv uses pip without respecting the --pypi-mirror setting.
If PyPI is inaccessible during this process, virtualenv falls back to using local copies of necessary packages and pipenv silently proceeds. However, if connections to PyPI time out (e.g. if packets are dropped instead of rejected by a firewall), pip (and virtualenv) will hang, and pipenv will timeout.
The text was updated successfully, but these errors were encountered: