-
-
Notifications
You must be signed in to change notification settings - Fork 956
Add lockfileContents
option to loadPyodide()
#5764
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
Conversation
02d380a
to
7de7090
Compare
And also `packageBaseUrl` option: 1. If `lockfileContents` is provided and not `packageBaseUrl`, then in the browser attempting to load a lock entry with a relative path fails. 2. In Node, `packageBaseUrl` is used in place of jsdelivr as the cdn url if passed.
9613447
to
df050ea
Compare
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.
Thanks. Ideally, I would like to deprecate LockFileURL
instead of having two different options doing the same thing. WDYT?
Thanks for the review @ryanking13! |
I don't think it's worth the churn to deprecate this since it causes no extra maintenance burden. |
does it mean that with content created via I am trying to implement the dance that must work on any pyodide version and this detail seems to be very important to understand properly ... I am not sure |
Here are some changes related to the lockfile.
So...
In Pyodide 0.28.1, no.
|
@ryanking13 crystal clear, thank you! |
for more information, see https://pre-commit.ci
eee6723
to
f124a78
Compare
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.
Thanks. There is a test failure, otherwise looks good to me.
options_.cdnUrl = | ||
options_.packageBaseUrl ?? | ||
`https://cdn.jsdelivr.net/pyodide/v${version}/full/`; |
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.
Shouldn't it always be https://cdn.jsdelivr.net/pyodide/v${version}/full/
, as we use this only for a fallback?
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 am not sure. But:
- the caching system only works if
file_name
is relative, otherwise we will try to download the url every time and won't do any caching - if the user has a custom lock file, then any additional packages definitely won't be available on jsdelivr
So if they are to have any chance of using the caching mechanism with their own lock file, they need to be able to adjust the cdnURL
.
@@ -254,7 +299,7 @@ export async function loadPyodide( | |||
config.env.PYTHONINSPECT ??= "1"; | |||
const emscriptenSettings = createSettings(config); | |||
const API = emscriptenSettings.API; | |||
API.lockFilePromise = loadLockFile(config.lockFileURL); | |||
API.lockFilePromise = Promise.resolve(options_.lockFileContents); |
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.
It is a bit confusing to have all of config
, option
, and option_
here. But I guess I'll be able clean it up in #5746.
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.
Well options_
and options
are identical things just with different types.
The failing test doesn't actually pass for me on the main branch... |
Maybe my micropip is out of date... |
This reverts commit f4939cb.
for more information, see https://pre-commit.ci
And also `packageBaseUrl` option: 1. If `lockfileContents` is provided and not `packageBaseUrl`, then in the browser attempting to load a lock entry with a relative path fails. 2. In Node, `packageBaseUrl` is used in place of jsdelivr as the cdn url if passed. See discussion in pyodide#5736.
Thanks! |
And also `packageBaseUrl` option: 1. If `lockfileContents` is provided and not `packageBaseUrl`, then in the browser attempting to load a lock entry with a relative path fails. 2. In Node, `packageBaseUrl` is used in place of jsdelivr as the cdn url if passed. See discussion in pyodide#5736.
any eta for a new release? we're going on vacation and we'd love to be able to bring in latest Pyodide before doing that, so that anyone playing around our project could benefit from its latest/greatest, thank you! |
And also `packageBaseUrl` option: 1. If `lockfileContents` is provided and not `packageBaseUrl`, then in the browser attempting to load a lock entry with a relative path fails. 2. In Node, `packageBaseUrl` is used in place of jsdelivr as the cdn url if passed. See discussion in pyodide#5736.
And also `packageBaseUrl` option: 1. If `lockfileContents` is provided and not `packageBaseUrl`, then in the browser attempting to load a lock entry with a relative path fails. 2. In Node, `packageBaseUrl` is used in place of jsdelivr as the cdn url if passed. See discussion in pyodide#5736.
And also
packageBaseUrl
option:lockfileContents
is provided and notpackageBaseUrl
, then in the browser attempting to load a lock entry with a relative path fails.packageBaseUrl
is used in place of jsdelivr as the cdn url if passed.See discussion in #5736.