pypa / pip

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

Deprecation warning about normalized names unclear #2136

Closed orodbhen closed 9 years ago

orodbhen commented 9 years ago

After creating a package index for our LAN using the dir2pi tool, I had to install the dev version of pip in order to get case-insensitive searches on a file:/// url.

However, now I get this warning:

"DEPRECATION: One or more of your dependencies required using a deprecated fallback to looking at /simple/ to discover it's real name. It is suggested to upgrade your index to support normalized names as the name in /simple/{name}."

I'm not really sure what is meant by this, or how to comply with it.

I read through this discusssion, but I'm still not clear on what the new directory structure of the index should be.

Perhaps a link to the documentation for this deprecation could be added to the warning message.

dstufft commented 9 years ago

The names like packages/simple/Bar/bar-0.8.tar.gz need normalized to packages/simple/bar/bar-0.8.tar.gz where normalization is basically pkg_resources.safe_name.

orodbhen commented 9 years ago

Thanks for the quick response.

So do the names of the package directories only need to be changed, or the names of the package archives as well?

dstufft commented 9 years ago

Just the names of the directories. This was primarily aimed at HTTP where we wanted to be able to know ahead of time given something like pip install Foo what URL should we request so as not to get a redirect (on PyPI) or fall back to fetching the index to discover the "real" name (Bandersnatch, dir2pi, etc). Since authors could register Foo or foo or fOo and we had no way to determine what it should be we moved towards normalization so that there is a deterministic method of obtaining the expected /simple/{insert name}/ path for any particular dependency.

orodbhen commented 9 years ago

Ok. I'll need to patch dir2pi then, so it will normalize the directory names. Thanks.