-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a --index-urls
CLI flag for pip-install magics
#166
Comments
I'm happy to assign this to myself, and volunteer to work on it next week :D |
--index_urls
CLI flag for pip-install magics--index-urls
CLI flag for pip-install magics
Thanks for volunteering! |
Sure, that's a fine one to support. In general, when adding features to
{
"jupyter-lite-schema-version": 0,
"jupyter-config-data": {
"appName": "JupyterLite Pyodide Kernel",
"litePluginSettings": {
"@jupyterlite/pyodide-kernel-extension:kernel": {
"pipliteInstallDefaultOptions": {
"indexUrls": ["http://..."]
}
}
}
}
} Of note, until
vs
and then
Custom indexes are not included in this, as no upstream list of wheels provide importable names, to my knowledge. |
Problem
piplite
supports passing a string or a list of strings of index URLspyodide-kernel/packages/pyodide-kernel/py/piplite/piplite/piplite.py
Line 134 in 36aedb9
but it does not yet provide a CLI flag for them, so it is currently not possible to write commands
%pip install numpy --index-urls https://anaconda.org/scientific-python-nightly-wheels/simple
, as extra indices are/will be ignored and NumPy 2.0.2 from the Pyodide distribution is installed instead.Proposed Solution
Extend https://github.com/jupyterlite/pyodide-kernel/blob/36aedb97d38cf283df8c3b0d65d7d6b8e575f0ab/packages/pyodide-kernel/py/piplite/piplite/cli.py to have a simple
--index-urls
option that is passed topiplite.py
, at first. It could be extended to--index-url
or--extra-index-url
options later if and when such a change is brought upstream inmicropip
.Additional context
xref: pyodide/pyodide#4898 (comment), as I've been meaning to test out the rollout of CORS headers for the Anaconda.org PyPI-like index through
piplite
, but I found I was unable to do so, whilemicropip
works.The text was updated successfully, but these errors were encountered: