When a PR is opened, the GHA workflow will build submitted packages and run tests on them. It only builds the packages that have been modified in the PR, and their dependenciesto reduce the build time. See tools/calc_diff.py for the logic used to determine which packages to build.
When the PR is merged, the GHA workflow will build all packages in the repository and run tests on them.
Optionally, you can trigger a full build by adding the [full build] in the PR title.
The packages are always built with the tip-of-tree commit of Pyodide, fetching it directly from the CDN. This is to ensure that the packages in this repository are always compatible with the latest version of Pyodide.
Adding a new tag to the repository will trigger a release of the package set.
It is recommended to use the calendar versioning scheme for tags, e.g. 20240810.
git tag 20240810
git push origin 20240810
After the release is made, you can update the package set in the Pyodide distribution
by updating the Makefile.envs file in the pyodide/pyodide repository.
To build and test packages locally, you need to prepare the necessary tools and dependencies.
- compatible Python version
- pyodide-build, which is provided by the
pyodide-buildGit submodule in the repository root - emscripten
- selenium (for testing)
The compatible Python version is specified in the environment.yml file in the root directory of the repository.
If you are using conda, you can create a new environment with the following command:
conda env create -f environment.yml
conda activate pyodide-envAfter activating the environment, you can install the necessary tools and dependencies with the following command:
./tools/prepare_pyodide_build.sh
python tools/install_and_patch_emscripten.pyThis will install the pyodide-build and emscripten tools in the current environment.
You can then build the packages with the following command:
pyodide build-recipes "<pkg1>,<pkg2>,..."To update the Pyodide xbuildenv, you need to update the default_cross_build_env_url variable in the pyproject.toml file.
Note
This section is not implemented yet. It mostly describes the intended behavior in the future, and is not a description of the current behavior.
The pyodide-recipes repository is used to build packages for both stable and nightly versions of Pyodide.
We use different branches for those versions:
main: the default branch, used for nightly versions of Pyodide- It uses nightly xbuildenv and the pyodide-build submodule to build packages.
<version>: a branch for stable versions of Pyodide- It uses stable xbuildenv and pyodide-build submodule (or a stable version, if there are any breaking changes) to build packages.
Let's say we have a stable Pyodide version 0.27.0, and we are developing a new version 0.28.0.
- We use two branches:
0.27.Xandmain. - The
0.27.Xbranch is used to build packages for the stable version0.27.X.- If we need any bugfixes or new packages for the stable version, we push them to the
0.27.Xbranch.
- If we need any bugfixes or new packages for the stable version, we push them to the
- The
mainbranch is used to build packages for the nightly version.- Any new packages or bugfixes that are not compatible with the stable version will be pushed to the
mainbranch. - The
mainbranch will be used to release the package set for0.28.0.
- Any new packages or bugfixes that are not compatible with the stable version will be pushed to the
- After the release of
0.28.0, we will create a new branch0.28.Xfrom themainbranch.- The
0.28.Xbranch will be used to build packages for the stable version0.28.X.
- The