[Catalog-sig] start on static generation, and caching - apache config.

Phillip J. Eby pje at telecommunity.com
Tue Jul 10 02:34:26 CEST 2007


At 12:16 AM 7/10/2007 +0200, Martin v. Löwis wrote:
> > Requests for http://www.python.org/pypi/ take
> > about 10 seconds.
>
>Why does that matter for setuptools? Does setuptools ever look at this
>page?

Yes, in order to find the correct spelling for a package's name.  If 
a user types, say "pylons" when the package is listed on PyPI as 
"Pylons", setuptools looks at the root after the lookup of 
/pypi/pylons fails.  This need could be eliminated if PyPI would 
canonicalize package names case-insensitively, collapsing all 
non-alphanumeric characters (other than '.') to a single '-'.  i.e.:

def safe_name(name):
     """Convert an arbitrary string to a standard distribution name

     Any runs of non-alphanumeric/. characters are replaced with a single '-'.
     """
     return re.sub('[^A-Za-z0-9.]+', '-', name)

A case-insensitive match by safe_name would be ideal, and could also 
be used to prevent users from registering packages whose names differ 
only by case or punctuation.




More information about the Catalog-SIG mailing list