[Distutils] distlib locator compares reasonably well with pip's PackageFinder

Vinay Sajip vinay_sajip at yahoo.co.uk
Thu Oct 25 11:38:20 CEST 2012

As an extended test of the locator functionality in distlib, I compared the
results from the locate() API with the results from pip's PackageFinder. The
results seem encouraging: out of 24938 packages tested, only 510 (2%) gave
different results from pip. Out of the 510, many are due to:

1. distlib (currently) looks for archives which are machine-independent, and
   skips archives which contain machine-dependent strings in their names.
2. distlib (currently) skips archives automatically generated by sites like
   GitHub and BitBucket, since the download archive doesn't always contain
   version information in the name of the download. Examples:


In a (much) smaller number of cases, the differences are because locate() found
an archive where pip didn't. But for 98% of the projects registered on PyPI,
locate() returns identical results to pip's PackageFinder.find_requirement,
and does it slightly faster in most cases :-)

The comparison script, along with the list of differences, is at



Vinay Sajip

More information about the Distutils-SIG mailing list