-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Fix PyPI Downloads --- The Right Way #2281
Description
We can't do this for every crazy download site out there. But PyPI is important and provides lots of stuff to Spack. So let's get it right... here is the link describing their XMLRPC API:
https://wiki.python.org/moin/PyPIXmlRpc
-
We can use this to create a
url_for_version()method that will call the API'srelease_urls(package_name, version)to determine the download URL. It should NOT download the checksum at install time, since the whole point is to CHECK it at install time. -
This new
url_for_versionwould come standard in thePyPIPackagebase class. Or... we provide it as a method and ask Package authors to writeurl_for_version = pypi_url_for_versionas needed. -
We can use the API to improve automagic generation of PyPI packages. The auto-generator would query it for a bunch of URLs and checksums. If we're clever enough with picking apart
package.pyfiles, we could even have a procedure that auto-updates apackage.pyfile for new versions of the package.