Open yu0A opened 11 months ago
Could you share a little more detail and a code that we can reproduce the error?
OK Run this in a Vue template project. `
`
My further request is skipping the whl integrity check of micropip.xxx.whl
I just uploaded a Quasar CLI Vite project so that you can reproduce this bug. vue_quasar_admin
How to reproduce?
If you change the file to https://files.pythonhosted.org/packages/2a/2b/fb867ed1e62954e8b9d9211f9c6ce028d4f630cab779815279adde9e3fdd/micropip-0.5.0-py3-none-any.whl, you can reproduce this error.
Oh, yes. It is expected error, as the sha256 checksum will change if you change the file. So you need to either,
checkIntegrity
options to false, orI did not search out the word checkIntegrity. Could you provide a settings.js with default settings for me?
pyodide.loadPackage(<pkg_name>, { checkIntegrity: false })
I get it. Another question is, can I use a global setting config file to config the default settings of pyodide.loadPackage()? E.g. in Electron(Node) apps, developers hope that they can set { checkIntegrity: false } by default so that they can focus on front-end code development but keep whls unchanged.
No, currently, there is no global setting for it. Probably you can re-define pyodide.loadPackage
such as:
const origLoadPackage = pyodide.loadPackage
pyodide.loadPackage = (...) => orignLoadPackage(..., {checkIntegrity: false})
?
you can re-define
pyodide.loadPackage
This is the solution I would recommend as well.
Failed to find a valid digest in the 'integrity' attribute for resource 'http://localhost:9000/node_modules/pyodide/micropip-0.5.0-py3-none-any.whl' with computed SHA-256 integrity 'KFZn0rkbV86HyQAlSLlknsu+HplrTX9Miq+rebxMs8A='. The resource has been blocked.