-
Notifications
You must be signed in to change notification settings - Fork 347
[wip] Update to pyodide 0.22.0, use pyodide and serviceworker types #871
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
@@ -582,10 +462,10 @@ export class PyoliteRemoteKernel { | |||
reject: () => void; | |||
resolve: () => void; | |||
} | null = null; | |||
protected _pyodide: Pyodide.PyodideInterface = null as any; |
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.
not proud of this...
/** TODO: real typing */ | ||
protected _localPath = ''; | ||
protected _driveName = ''; | ||
protected _pyodide: any; | ||
protected _kernel: any; |
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.
These any
s still kill me. Among the tasks we should explore in #386 are:
- doing a thorough typing of all our custom classes
- generating typescript types from the python types Typescript types for Python objects pyodide/pyodide#2162
registration = | ||
(await serviceWorker.getRegistration(serviceWorker.controller.scriptURL)) || | ||
null; | ||
console.info('JupyterLite ServiceWorker was already registered'); |
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.
ref #751
Seems to be working on CI. Still no progress on #840, even when trying a more complex setup for handling potential race conditions on the Had a look at a few other things, rolled them back:
|
if ( | ||
length <= 0 || | ||
stream.file === undefined || | ||
position >= (stream.file.data.length || 0) |
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.
ref
There's still something happening in the pyolite case, where doing successive writes
without closing between them yields a database disk image is malformed
@@ -197,6 +78,7 @@ export class PyoliteRemoteKernel { | |||
protected async initKernel(options: IPyoliteWorkerKernel.IOptions): Promise<void> { | |||
// from this point forward, only use piplite (but not %pip) | |||
await this._pyodide.runPythonAsync(` | |||
await piplite.install(['sqlite3'], keep_going=True) |
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 will still be needed in #909
PYODIDE_CDN_URL = APP_SCHEMA_PYOLITE["properties"]["pyodideUrl"]["default"] | ||
PYODIDE_VERSION = _js_version_to_py_version(PYODIDE_JS_VERSION) | ||
PYODIDE_JS = PYODIDE_CDN_URL.split("/")[-1] | ||
PYODIDE_ARCHIVE = f"pyodide-{PYODIDE_VERSION}.tar.bz2" |
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 name will need to change, removing -build
in #909
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.
Sounds good let's keep track of that in #909.
References
attachment:
URLs incorrectly routed to ServiceWorker #792 (it wasn't really broken)Code changes
pyodide
topyodide-kernel/package.json#/devDependencies
import type
d in.ts
pyodide 0.22.0a3
ERRNO_CODES
pyodide._module
lerna 6
typedoc
typescript
prettier
BroadcastChannel
out of server, put in contentsServiceWorker
andBroadcastChannel
services.js
intoserver/sw.ts
SKIP_ESLINT
env varUser-facing changes
Backwards-incompatible changes
sqlite3
change might have been surprising...IPython
can load