-
Notifications
You must be signed in to change notification settings - Fork 35
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
[do not merge] test python support #452
base: main
Are you sure you want to change the base?
Conversation
Note that Python 3.13 has official support for WASI, so that seems reasonable to target, although you have to compile from source as it is not yet released (I don't know if they will have an official WASI binary). |
var script = "print(\"hello python!\")"; | ||
|
||
FileWriter fileWriter = new FileWriter(new File("/tmp/try-python-wasm").toPath().resolve("test.py").toFile()); | ||
PrintWriter printWriter = new PrintWriter(fileWriter); |
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.
Nit: you can use Files.writeString()
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.
removed
var fakeStdout = new MockPrintStream(); | ||
var fakeStderr = new MockPrintStream(); | ||
FileSystem fs = | ||
Jimfs.newFileSystem( |
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.
Should we add an <optional>true</optional>
dependency on Jimfs and add a utility method for this?
@electrum I found some unofficial CPython Wasi pre-releases: And it works! |
It's possible to use wizer to improve startup time after you've run all the imports statements. |
Most of the projects to run Python on WASI are in a bad state, so, I think that we should not test in CI against outdated toolchains.
That said, this tutorial:
https://wasmlabs.dev/articles/python-wasm32-wasi/
kind of works for dummy examples.