Skip to content

Conversation

@bkiu
Copy link

@bkiu bkiu commented May 21, 2024

This is a command to convert an existing pyscript project for use offline. It depends on pyscript/pyscript#2077 to pull the correct files via a tarball of built files.

The project path is passed through the first and only required argument,

It downloads the following resources:

  • pyscript files from pyscript.net
  • pyodide files from Github
  • micropython files from cdn.jsdelivr.net

The option is available to download the entire pyodide library via the download-full-pyodide flag.

All relevant HTML files are also updated to point to the local /pyscript/ directory instead of https://pyscript.net....

Since there's not an easy way to retrieve all the active configuration files in use, config-files is a comma-separated list of files to be passed in. The script then loops through those files and updates the interpreter to the local one based on what is passed through the --interpreter option (defaults to pyodide, which may or may not be a good idea).

Finally, it also warns the user if any <py-config> or <mypy-config> tags are found, as it doesn't update the interpreter in those tags.

Written at PyCon US 2024 sprints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant