-
Notifications
You must be signed in to change notification settings - Fork 1.5k
V0.6.x micropip often fails to discover package #2228
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
Comments
- Switch to `Bun` for building JS - Minor cleanup to pyscript renderer - Revert pyscript version to 0.5 due to [bugs](pyscript/pyscript#2228)
Aha, I think the cache is not smart enough to handle versioning, which is indeed a bummer. /cc @ntoll |
Something notable is I don't believe this is related to versioning, because if I refresh the web page it proceeds to break again. More accurately, anytime that pyodide is loaded from indexdb, then micropip does not work. I haven't dug much deeper than that, but perhaps micropip somehow gets mangled when loading from indexdb. |
all I hear is that this might be a Pyodide issue with the locked dependencies which would be unfortunate but right now this is just speculation as I haven't had a chance yet to look at this issue ... on my next TODO list |
OK, I did investigate a bit around this issue and I am not sure I have much to share about it if not details:
Dare I summon @hoodmane around this issue because I am not really sure what is going on ... to recap:
|
for what is worth it, this page does the following: <!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<script type="module" src="https://cdn.jsdelivr.net/npm/@pyscript/core/dist/core.js"></script>
</head>
<body>
<script type="py" config='{"packages":["jsonpointer==3.0.0"]}'>
print('Hello World')
</script>
</body>
</html>
Apologies for the second ping @hoodmane ... but wasn't the whole reason to have I would be OK if once dependencies are frozen I need to remove those pinned versions out of the blue in our logic but I wonder if this is what everyone else expects too 🤔 |
Yeah we don't have any logic for parsing requirement specifiers in function requirementToName(requirement) {
return requirement.split(/[^A-Za-z_-]/,1)[0];
} Perhaps we should explain the workflow for freezing requirements somewhere in our docs... |
@hoodmane thanks for the prompt answer but I'd raise an issue in Pyodide because to me it's not even clear where I should drop versioning .. I have the |
Thanks for opening the issue @WebReflection. I'll copy my comments and we can discuss more over there. |
This has been fixed and you should be able to test |
@Archmonger FYI we're out with latest release that fixes this and much more. You don't need to erase IndexedDB as the fix already takes care of previously stored packages by their own pinned version, it's just loading pyodide that changed so you should be covered. On the other hand, remember that enforcing |
Thanks for the quick turnaround. I'll bump the pyscript version in |
I'd rather thank you for the issue and the patience in explaining what's going on ... this also landed as manual test (due refresh needed across checks) but I think we've tackled the root of the issue and in the worst case scenario, our workaround will stick in time, in the best one, pyodide will handle this for us and we change a single line of code in the future trusting pyodide to handle this later on. Also apologies we shipped something that clearly didn't have enough tests to guarantee all scenarios were covered, that's mostly on me as I never thought about pinned versions and belived that would've been handled out of the box. Lesson learned from my side. |
I haven't take a peek at your CI, but you could always have a live server test case using Python Playwright that handles the "manual refresh" nature of these tests. For example, we currently do some Playwright tests with "new tab" operations. I am likely going to include refresh tests on my side of the fence moving forward, but could be good to have it your CI too. |
The background thing is that I didn't think about pinned versions so that even implementing your new tab strategy would've failed your expectations but I need to dig into the new tab approach to validate twice everything is fine: that's a very good hint that might become handy in more than just this occasion. I will open an issue about this, thanks for the hint! |
Here we go, I'll try to tackle that sooner than later: #2233 |
Checklist
What happened?
There seems to be a regression on Micropip behavior on v0.6.x where micropip will fail to install packages if the user has pyodide cached within the browser's
IndexDB
.Upon clearing indexdb, the browser will then be able to install packages via micropip again.
This was tested on all Chrome, FF, and Edge on Windows 11.
This issue does not exist on
0.4.x
and0.5.x
.What browsers are you seeing the problem on? (if applicable)
Firefox, Chrome, Microsoft Edge
Console info
custom.js:182 Uncaught (in promise) Error: No known package with name 'jsonpointer==3.0.0' at addPackageToLoad (pyodide.asm.js:10:90432) at recursiveDependencies (pyodide.asm.js:10:90746) at loadPackage (pyodide.asm.js:10:93056) at initializePackageIndex (pyodide.asm.js:10:89787)
Additional Context
The text was updated successfully, but these errors were encountered: