-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add support for wasm32-pyodide #190
base: main
Are you sure you want to change the base?
Conversation
# we will need to import the file each time so that the mocking will be | ||
# effective. The function is used during initialization so it will not be | ||
# an overhead | ||
def is_wasm() -> bool: |
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.
hi sorry for the late reaction.
I think I instead of checking for was and polluting the class, I would prefer to have a validate_params_for_platform(params: Parameters) -> None
that raises the error.
This can be made efficient by having the sys.platform
check at module level and defining different functions. For non-wasm it would be a return None
. You can also set DEFAULT_PARALLELISM
in the same block
Summary
I was trying to use this library in Pyodide WASM runtime but it was not supported.
I added the required packages according to their guidelines. There are issues in Threading so I added a check for
parallelism != 1
based on theplatform.machine()
.Pyodide patch
Alternative solution
Pyodide supports patching: instead of providing
wheel
one could provide the source code and this patch, but there will need to build everything from scratch.Can we work this out?