-
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
Support passing of index URLs to piplite (CLI, runtime configuration, and requirements files) #169
base: main
Are you sure you want to change the base?
Conversation
Here, we just assume one index per requirement file as this is the pip behaviour. Multiple indices will require different requirements files in subsequent commands.
cc: @bollwyvl I can write TypeScript to get by, but it is still very much Greek to me. Even though this is a draft, I would like to hear more from you about my approach and whether I'm going in the right direction with these changes when you have time. :) I think splitting the changes into multiple PRs might also be possible. Also, you mentioned "support parsing of said feature as a line of |
The fact that it's tricky to get a development version installed for me does not help either 😅 It took me a few tries but testing in CI is probably more convenient. |
|
Trying to test this with the Anaconda index |
A bit more testing reveals that this works well. Here are a few points about things I noticed, and some questions:
|
"description": "Default options to pass to piplite.install", | ||
"default": {}, | ||
"properties": { | ||
"indexUrls": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would reckon this should be index_urls
, and then wherever possible, the parent object handed around as a blob of JSON-compatible kwargs.
const pythonConfig = [ | ||
'import piplite.piplite', | ||
`piplite.piplite._PIPLITE_DISABLE_PYPI = ${disablePyPIFallback ? 'True' : 'False'}`, | ||
`piplite.piplite._PIPLITE_URLS = ${JSON.stringify(pipliteUrls)}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would then become piplite.piplite._PIPLITE_DEFAULT_INSTALL_ARGS
Co-Authored-By: Nicholas Bollweg <bollwyvl@users.noreply.github.com>
Co-Authored-By: Nicholas Bollweg <bollwyvl@users.noreply.github.com>
The integration tests are now timing out. I'm not sure if this is due to a change I made... reverting and trying again This is what the logs were saying from the RTD build:
Edit: this was indeed due to my change. I'll take a look at it again. |
e1fd8bb
to
e4e7a30
Compare
I seem to have broken the installation of packages from an in-line index URL inside a My idea is that if we are to support multiple index URLs and multiple requirements files, each of those files could possibly use a non-default index URL, i.e., |
Never mind: actually, a local test to see This should make things a bit more simpler. Pro tip: never combine the act of installing packages from separate indices and requirements files, and invoke a |
3fadb88
to
d694c00
Compare
d9f112e
to
3fc2381
Compare
I think this PR is ready to garner some more feedback. About the #166 (comment) mentioned adding it as a site-level configurable, but in this case, this acts more like I feel we should limit my scope with this PR, but I am happy to implement what sounds best either upstream or here. |
Description
Users can now specify alternate package indices to install packages with
micropip
through multiple interfaces: thepiplite
command line interface (-i
/--index-url
), requirements files, and site-wide configuration in jupyter-lite.jsonCloses #166
Changes made
These are mostly along the lines of #166 (comment).
In the Python layer
-i
/--index-url
flags in the piplite CLI,piplite
along with an index URL (the index URL is applied to the entire list of requirements coming from the file, akin to whatpip
does: https://stackoverflow.com/a/2477610).In the TypeScript/configuration layer
pipliteInstallDefaultOptions
withindexUrls
configurationIPipliteInstallOptions
to add type safety for index URL parametersindexUrls
from thejupyter-lite.json
runtime configurationPyodideRemoteKernel
'sinitPackageManager
method to configure index URLs in the Python environmentThe idea is to get the following behaviour in
piplite
:requirements.txt
filejupyter-lite.json