pypa / pip

The Python package installer
https://pip.pypa.io/
MIT License
9.46k stars 3k forks source link

Document the Effect of --use-mirrors and improperly named packages #473

Closed dstufft closed 10 years ago

dstufft commented 12 years ago

Currently PyPI redirects an incorrectly cased name to the proper name (e.g. django -> Django), however the current official mirrors do not do that.

This has the affect that all packages that are being attempted to be installed without the name typed exactly right, will succeed in most cases, but will continue to fail when PyPI is down. This can cause some apparent wierdness to people who don't understand the reasoning (why pip install django works when PyPI is up, but not when it's down, meanwhile other packages install just fine).

I would suggest documenting this (hopefully edge) case as a possible gotcha and to help educate folks to use the proper name for their packages, especially in their requirements files.

carljm commented 12 years ago

Le sigh. Documentation seems a totally inadequate fix for this, but I imagine for backwards-compatibility reasons PyPI won't change their behavior, and it would be technically quite difficult for mirrors to emulate PyPI without having to become dynamic. I wonder if we could/should actually add a specific warning output when a package is not found using a mirror.

dstufft commented 12 years ago

Yea, there's more redirects than just a simple case insensitive going on (as I discovered with Crate) so even if the mirrors could become case insensitive there's more to it than that.

PyPI itself is one of the mirrors (a.pypi.python.org) so when PyPI is up inproperly cased/named packages will still get fetched from PyPI (and hopefully crate once I finish the PEP381 stuff). So theortically this issue would only occur in a way that end users notice when PyPI is down. And when/if I get Crate into the official mirror rotation it would also work to catch the django -> Django redirection and help cover the gap so it would require both PyPI and Crate to be down.

dstufft commented 12 years ago

But yes, I think PyPI doing redirects here is the wrong behavior :| Especially since they also redirect in a "normalized name" too, http://pypi.python.org/simple/django-compressor/ -> http://pypi.python.org/simple/django_compressor/

dstufft commented 12 years ago

Once crateio/crate-site#37 gets finished, and assuming that PyPI accepts crate.io as a mirror the effects of this will be smaller. Crate properly does all the same redirects as PyPI (and if i'm missing one I consider it a bug). If PyPI is down Crate would pick up the slack from it and still allow the incorrectly cased names/normalized names still resolve.

dstufft commented 10 years ago

--use-mirrors has been deprecated and this is no longer a concern.