distribution name capitalisation considered important ; -)

Hi All, Looks like we have quite a consistent set of rules with regard to captilisation of package names on file systems where case isn't important, shame the same can't be said for distribution names. So, looks like case is important in package names. With distribution names, it becomes much more murky. Setuptools, and so all the ilk that use it, is happy to ignore case naming for distributions. To make matters worse, it also uses os.path.normcase on any distributions obtained from a Windows file system, which will *always* corrupt any distribution names that aren't all lower case already. These differences cause subtle problems in tools which attempt to pin versions of particular distributions. So, I guess I'm asking why we don't just say "distribution names are case sensitive" and be done with it? If the case of a requirement or distribution name is wrong, it would be good to get early failures rather than subtle and annoying bugs later on down the line. Of course, the horse is already bolted on this. The only "sane" option now would be for all distribution names to be lowercased by all tools all of the time. How do others feel about this? Chris

On 9/15/2010 9:53 AM, Chris Withers wrote:
Of course, the horse is already bolted on this. The only "sane" option now would be for all distribution names to be lowercased by all tools all of the time. How do others feel about this?
I have been bitten by this recently, with pinning versions via buildout. I agree it would be nice to make everything case sensitive, but I also agree that's not practical. I think lowercasing is reasonable. Eric.

Looks like we have quite a consistent set of rules with regard to captilisation of package names on file systems where case isn't important, shame the same can't be said for distribution names. [...]These differences cause subtle problems in tools which attempt to pin versions of particular distributions. Going by what you wrote about pinning versions, are you talking about Buildout? The only "sane" option now would be for all distribution names to be lowercased by all tools all of the time. How do others feel about this?
On 9/15/2010 6:53 AM, Chris Withers wrote: pip, easy_install and pypm already ignore case. But not buildout? I suggest that we a) make pypi disallow registering package names with a differing case b) make buildout case-insensitive. -srid

On 15/09/2010 16:57, Sridhar Ratnakumar wrote:
On 9/15/2010 6:53 AM, Chris Withers wrote:
Looks like we have quite a consistent set of rules with regard to captilisation of package names on file systems where case isn't important, shame the same can't be said for distribution names. [...]These differences cause subtle problems in tools which attempt to pin versions of particular distributions. Going by what you wrote about pinning versions, are you talking about Buildout?
Yes, but I expect the subtleties apply to otehr tools too...
The only "sane" option now would be for all distribution names to be lowercased by all tools all of the time. How do others feel about this? pip, easy_install and pypm already ignore case.
...sometimes ;-)
But not buildout? I suggest that we a) make pypi disallow registering package names with a differing case
That won't help, and it's not feasible. PyPI is far from the only index people use.
b) make buildout case-insensitive.
Indeed. Chris

On 15/09/2010 16:57, Sridhar Ratnakumar wrote:
Looks like we have quite a consistent set of rules with regard to captilisation of package names on file systems where case isn't important, shame the same can't be said for distribution names. [...]These differences cause subtle problems in tools which attempt to pin versions of particular distributions. Going by what you wrote about pinning versions, are you talking about Buildout? Yes, but I expect the subtleties apply to otehr tools too... Hmm. I wonder if distutils2' metadata parser and distribution classes (will) handle names case-insensitively. lowercased by all tools all of the time. How do others feel about this?
On 9/15/2010 6:53 AM, Chris Withers wrote: pip, easy_install and pypm already ignore case. The only "sane" option now would be for all distribution names to be
...sometimes ;-)
But not buildout? I suggest that we a) make pypi disallow registering package names with a differing case That won't help, and it's not feasible. PyPI is far from the only index people use. Are there package indexes, apart from PyPI, that allows registering
On 9/15/2010 8:59 AM, Chris Withers wrote: pypm always ignores case, I am not sure about pip, easy_install. "pip|easy_install install pastescript" worked for me though. packages?
b) make buildout case-insensitive. Indeed. Doing so is a good idea. It didn't lead to any conflicts at least in my experience. Maybe make this part of the metadata parser in distutils2, Tarek?
-srid

At 04:59 PM 9/15/2010 +0100, Chris Withers wrote:
On 15/09/2010 16:57, Sridhar Ratnakumar wrote:
On 9/15/2010 6:53 AM, Chris Withers wrote:
Looks like we have quite a consistent set of rules with regard to captilisation of package names on file systems where case isn't important, shame the same can't be said for distribution names. [...]These differences cause subtle problems in tools which attempt to pin versions of particular distributions. Going by what you wrote about pinning versions, are you talking about Buildout?
Yes, but I expect the subtleties apply to otehr tools too...
The only "sane" option now would be for all distribution names to be lowercased by all tools all of the time. How do others feel about this? pip, easy_install and pypm already ignore case.
...sometimes ;-)
I can't speak to the others, but setuptools *always* ignores case. If you have found it not to, please file a bug report so I can fix it.

On 15/09/2010 19:58, P.J. Eby wrote:
I can't speak to the others, but setuptools *always* ignores case. If you have found it not to, please file a bug report so I can fix it.
Where's the right place to report? The problem I had was using a file:// to find-links on Windows, whereby setuptools ends up causing os.path.normcase to be called on the distribution name, lowercasing an otherwise perfectly correctly cased distribution name... Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk

At 09:37 AM 9/20/2010 +0100, Chris Withers wrote:
On 15/09/2010 19:58, P.J. Eby wrote:
I can't speak to the others, but setuptools *always* ignores case. If you have found it not to, please file a bug report so I can fix it.
Where's the right place to report?
http://bugs.python.org/setuptools/
The problem I had was using a file:// to find-links on Windows, whereby setuptools ends up causing os.path.normcase to be called on the distribution name, lowercasing an otherwise perfectly correctly cased distribution name...
...resulting in what problem?

On 20/09/2010 22:16, P.J. Eby wrote:
The problem I had was using a file:// to find-links on Windows, whereby setuptools ends up causing os.path.normcase to be called on the distribution name, lowercasing an otherwise perfectly correctly cased distribution name...
...resulting in what problem?
...downstream tools, zc.buildout in this case, not functioning properly because their version pinning relies on consistent casing. Yeah, you could say it's a bug in buildout, but really, when the name is correct on disk and an intermediary tool decides to screw with the case for no good reason, I go with pointing the finger at the tool in the middle ;-) Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk

On Wed, Sep 15, 2010 at 9:53 AM, Chris Withers <chris@simplistix.co.uk> wrote:
Hi All,
Looks like we have quite a consistent set of rules with regard to captilisation of package names on file systems where case isn't important, shame the same can't be said for distribution names.
So, looks like case is important in package names.
With distribution names, it becomes much more murky. Setuptools, and so all the ilk that use it, is happy to ignore case naming for distributions. To make matters worse, it also uses os.path.normcase on any distributions obtained from a Windows file system, which will *always* corrupt any distribution names that aren't all lower case already.
These differences cause subtle problems in tools which attempt to pin versions of particular distributions.
I've pretty much decided to view these problems in buildout as bugs.
So, I guess I'm asking why we don't just say "distribution names are case sensitive" and be done with it? If the case of a requirement or distribution name is wrong, it would be good to get early failures rather than subtle and annoying bugs later on down the line.
Of course, the horse is already bolted on this.
Yup. Sadly.
The only "sane" option now would be for all distribution names to be lowercased by all tools all of the time. How do others feel about this?
Regardless of how this is accomplished internally, I agree that software (like buildout) that deals with project specifications needs to assume that project names are case insensitive. Jim -- Jim Fulton

On 17/09/2010 16:31, Jim Fulton wrote:
These differences cause subtle problems in tools which attempt to pin versions of particular distributions.
I've pretty much decided to view these problems in buildout as bugs.
Glad to hear it, in the meantime, buildout-versions works around the problem for anyone who hits it... There's a known issue with buildout-versions and mr.developer, but I have a patch, just waiting for tests... Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk
participants (6)
-
"Martin v. Löwis"
-
Chris Withers
-
Eric Smith
-
Jim Fulton
-
P.J. Eby
-
Sridhar Ratnakumar