pyodide / micropip

A lightweight Python package installer for Pyodide
https://micropip.pyodide.org
Mozilla Public License 2.0
76 stars 21 forks source link

ENH Support alternative index urls #74

Closed ryanking13 closed 1 year ago

ryanking13 commented 1 year ago

Resolve #7

This PR allows users to specify an index URL from which micropip can download packages. This allows users to install packages from a custom package index that provides PyPI-compatible APIs.

This PR covers both methods: modifying the index URL globally (micropip.set_index_urls) and passing the index URL as a parameter to micropip.install. This allows service operators like pyscript / jupyterlite to add their own package indexes as a default setting, while also allowing users to choose and use multiple indexes when needed.

ryanking13 commented 1 year ago

I removed the <package_name> placeholder limitation so that index URLs for Simple APIs (e.g. https://pypi.org/simple) can be passed without modification.