Skip to content
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

Experiment: Try loading multiple Python modules in Pyodide #53

Closed
jkwan2011 opened this issue Aug 2, 2023 · 3 comments
Closed

Experiment: Try loading multiple Python modules in Pyodide #53

jkwan2011 opened this issue Aug 2, 2023 · 3 comments
Labels
good first issue Good for newcomers heat-app-js Issues related to the HEAT app frontend rules-engine Issues related to the Python rules engine

Comments

@jkwan2011
Copy link
Collaborator

If we split the rules engine into multiple files, will Pyodide be able to load the modules correctly?

Try creating one Python file that loads another one (through import). Try loading the first file with Pyodide. Is the second module available for use, or does that file have to also be loaded separately with Pyodide?

@jkwan2011 jkwan2011 added good first issue Good for newcomers rules-engine Issues related to the Python rules engine heat-app-js Issues related to the HEAT app frontend labels Aug 2, 2023
@thadk
Copy link
Member

thadk commented Aug 2, 2023

Presently each *.py file gets loaded into javascript as a string and then sent to the pyodide interpreter to run it all into the Pyodide "global" python context.

If y'all generate a python package for the rules-engine (ideally with no fancy binary dependencies— "pure Python wheels" in the lingo), that can be imported by URL of the generated whl file with micropip.

@alanisaac
Copy link
Collaborator

For testing, we can try out loading across files in the same package using the code in the above PR (#78). If that doesn't work, we can go with wheels.

@jkwan2011
Copy link
Collaborator Author

jkwan2011 commented Oct 11, 2023

Python imports tested in #83.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers heat-app-js Issues related to the HEAT app frontend rules-engine Issues related to the Python rules engine
Projects
None yet
Development

No branches or pull requests

3 participants