At 08:29 AM 8/23/2005 +1000, Richard Jones wrote:
>On Tue, 23 Aug 2005 04:43 am, Phillip J. Eby wrote:
> > On the broader scope of things, I'd like to see PyPI smash all
> > non-alphanumeric runs in project names to a single '-', and use
> > case-insensitive project name comparison.  I'd attempt to try my hand at
> > PyPI patches but at the moment don't have any obvious way to test them.
>
>I'm not sure I'm comfortable with this. The only key of uniqueness for
>packages is <package name>/<version> ... if we start messing with the package
>name...

I'm just pointing out that these changes make the packaging system *more* 
robust, not less -- as long as it's done relatively soon.

Right now, we have people creating packages with names like "Python Super 
Whatchamacallit!" because they're not using the distutils and therefore 
don't notice that it's impossible to build a sane distribution with that 
name.  At the opposite extreme, we have packages with VERYMixedCase that 
nobody will ever remember how to type correctly except the package author.  :)

Neither of these is a big problem when EasyInstall isn't a part of the mix, 
because if the data's crap, who cares?  However, for EasyInstall it's not 
practical to try to type "easy_install 'Python Super Whatchamacallit!'" or 
"easy_install VERYMixedCase" and get it right.  It would be better if these 
names were canonicalized (internal to PyPI) as 
"python_super_whatchamacallit_" and "verymixedcase", with those values 
being used as database keys.  This would prevent having both a 
"VeryMixedCase" and a "VERYMixedCase" at the same time (e.g. 'sqlobject' 
and 'SQLObject').

Case-insensitivity is needed because some important platforms (Windows, Mac 
OS X) have case-insensitive filesystems.  Ergo, 'SQLObject-1.0-py2.3.egg' 
and 'sqlobject-1.0-py2.3.egg' are the *same file* on such systems, which is 
just not going to work.

Similarly, escaping non-alphanumerics as '_' (in both the project name and 
version) is necessary to ensure that egg filenames are unambiguously 
machine-readable.  Currently the distutils happily produces distributions 
with names like 'Paste-Deploy-1.2-prerelease.tar.gz', which are 
ambiguous.  A program can't tell with any certainty whether this is package 
"Paste", version "Deploy-1.2-prerelease", or package "Paste-Deploy-1.2", 
version "prerelease", or whatever else.  Any rule you can think of that 
would sort out the ambiguity, I can probably find an *actual* 
counterexample for you in the PyPI database!  (For example, there are 
packages with numbers in their names, so you can't use that to figure out 
where the version starts.)

Currently, I work around case-sensitivity and ambiguity on PyPI by doing a 
full index search if there's no correct case match.  I also build an index 
that contains all possible interpretations(!) of ambiguous filenames, so 
that I can match against what a user asked for.  Luckily, the odds of 
somebody mistakenly requesting version "Deploy-1.2-prerelease" of "Paste" 
and thereby getting Paste-Deploy version 1.2-prerelease instead are fairly 
low.  :)

However, while I can do that workaround for indexing PyPI's contents, it 
doesn't work for installed eggs; the names *must* be unambiguous in order 
to avoid the overhead of opening or extracting PKG-INFO in order to find 
out the distribution's name.  So egg files at least need to turn '-' to '_' 
in their filenames.

_______________________________________________
Catalog-sig mailing list
[email protected]
http://mail.python.org/mailman/listinfo/catalog-sig

Reply via email to