micropip icon indicating copy to clipboard operation
micropip copied to clipboard

use special values for Install from PyPI/Lock file in install(... index_url)/ Transaction.

Open Carreau opened this issue 1 year ago • 3 comments

from an high level API point of view, I think we could/should treat the pyodide_lock like another index, and when experimenting with proxy, I'd love to be able to explicitley remove the lock as a fallback.

I'm thinking we could assign a specific value say "LOCK" for an index URL and treat that a "look into the lock file".

This would allow things like

await micropip.install('whatever', index_url=['https://anaconda.org/alt_index', 'LOCK'])

or

# I want to make sure to install from PyPI.
await micropip.install('whatever', index_url=['https://pypi.org/simple'])

Along this vein, I think if we see the value 'PYPI', we could replace with "https://pypi.org/simple"

Thoughts @agriyakhetarpal ?

Carreau avatar Oct 22 '24 13:10 Carreau

Thanks for opening this before I did, @Carreau! I agree with this approach. It would be quite useful to provide an alias for PyPI and a lockfile.

piplite in JupyterLite seems to offer some additional features (https://jupyterlite.readthedocs.io/en/stable/howto/pyodide/packages.html) such as disabling PyPI fallback through the JSON file, I don't know if the opposite (i.e., what you suggest) is possible to do there?

agriyakhetarpal avatar Oct 22 '24 13:10 agriyakhetarpal

Sounds good to me.

How about PYODIDE_LOCK or just PYODIDE instead of LOCK? I think the word LOCK isn't that straightforward (some users don't actually need to know about the lockfile).

ryanking13 avatar Oct 25 '24 12:10 ryanking13

Yeah, I don't have any particular thoughts on the name, just that a sentinel value would I think be useful/helpfull.

Carreau avatar Nov 04 '24 10:11 Carreau