From db0ed639cc2cd71857caf5a55266a8d7f159f734 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Sun, 29 Jun 2025 20:15:52 +0530 Subject: [PATCH 1/2] Add `pyodide-build` with my branch as a submodule --- .github/workflows/build.yml | 8 ++++++++ .gitmodules | 4 ++++ .gitpod.yml | 7 ++++++- README.md | 15 ++++++++++++--- docs/MAINTAINERS.md | 6 +++--- pyodide-build | 1 + requirements.txt | 2 +- tools/prepare_pyodide_build.sh | 2 +- 8 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 .gitmodules create mode 160000 pyodide-build diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 56033d12..302f595c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,6 +36,8 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + submodules: recursive + persist-credentials: false - name: Install Emscripten ccache run: | @@ -244,6 +246,10 @@ jobs: steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + persist-credentials: false - name: Cache conda uses: actions/cache@v4 @@ -316,6 +322,8 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + submodules: recursive + persist-credentials: false - name: Setup Mambaforge uses: conda-incubator/setup-miniconda@v3 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..fbde7bab --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "pyodide-build"] + path = pyodide-build + url = https://github.com/pyodide/pyodide-build + branch = updates-for-scipy diff --git a/.gitpod.yml b/.gitpod.yml index bff76625..3dbc9cd5 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,13 +1,18 @@ additionalRepositories: - url: https://github.com/emscripten-core/emsdk + - url: https://github.com/pyodide/pyodide-build + checkoutLocation: pyodide-build tasks: + - name: Sync submodule(s) + init: git submodule update --init --recursive + command: echo "Submodules initialized" - name: Setup init: | pyenv global system conda env create -f environment.yml conda activate pyodide-env - pip install git+https://github.com/pyodide/pyodide-build.git + pip install ./pyodide-build/ pyodide xbuildenv install EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) diff --git a/README.md b/README.md index c94c1ad1..74488931 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,22 @@ Collections of package recipes for Pyodide ## Adding a new package -> Note: Use Python 3.12 or upper to run the following commands. +> Note: Use Python 3.13 or upper to run the following commands. To add a new package, create a package recipe in the `packages` directory. -You can start by creating a boilerplate recipe with the following command: + +It is required to clone the repository with the `--recurse-submodules` option to ensure +that all submodules are initialized. If hyou have already cloned the repository without +this option, you can run the following command to initialize the submodules: + +```bash +$ git submodule update --init --recursive +``` + +You can then start by creating a boilerplate recipe with the following command: ```bash -$ pip install pyodide-build +$ pip install ./pyodide-build $ pyodide skeleton pypi ``` diff --git a/docs/MAINTAINERS.md b/docs/MAINTAINERS.md index 5dc5481c..0bf644cd 100644 --- a/docs/MAINTAINERS.md +++ b/docs/MAINTAINERS.md @@ -30,7 +30,7 @@ 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 +- pyodide-build, which is provided by the `pyodide-build` Git submodule in the repository root - emscripten - selenium (for testing) @@ -71,9 +71,9 @@ The `pyodide-recipes` repository is used to build packages for both stable and n We use different branches for those versions: - `main`: the default branch, used for nightly versions of Pyodide - - It uses nightly xbuildenv and nightly pyodide-build to build packages. + - It uses nightly xbuildenv and the pyodide-build submodule to build packages. - ``: a branch for stable versions of Pyodide - - It uses stable xbuildenv and nightly (or stable if there is any breaking change) pyodide-build to build packages. + - 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`. diff --git a/pyodide-build b/pyodide-build new file mode 160000 index 00000000..5b5bfc7b --- /dev/null +++ b/pyodide-build @@ -0,0 +1 @@ +Subproject commit 5b5bfc7b4d85e2533174e037cbc1562c70bc09ee diff --git a/requirements.txt b/requirements.txt index 08c06f7c..1f626fa1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,6 +6,6 @@ pytest-httpserver pytest-benchmark auditwheel-emscripten pytest-asyncio -pyodide-build +./pyodide-build/ zstandard brotli diff --git a/tools/prepare_pyodide_build.sh b/tools/prepare_pyodide_build.sh index a4bbb0a0..dad6fbaa 100755 --- a/tools/prepare_pyodide_build.sh +++ b/tools/prepare_pyodide_build.sh @@ -1,4 +1,4 @@ #!/bin/bash -python -m pip install "git+https://github.com/pyodide/pyodide-build" +python -m pip install ./pyodide-build/ pyodide xbuildenv install \ No newline at end of file From c056f32e08b3c84d83ddd0cddb687013b4f0c981 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Mon, 30 Jun 2025 21:16:04 +0530 Subject: [PATCH 2/2] Update `pyodide-build` submodule, point to `main` --- .gitmodules | 1 - pyodide-build | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index fbde7bab..b32d197f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,3 @@ [submodule "pyodide-build"] path = pyodide-build url = https://github.com/pyodide/pyodide-build - branch = updates-for-scipy diff --git a/pyodide-build b/pyodide-build index 5b5bfc7b..ee118829 160000 --- a/pyodide-build +++ b/pyodide-build @@ -1 +1 @@ -Subproject commit 5b5bfc7b4d85e2533174e037cbc1562c70bc09ee +Subproject commit ee11882923d8e06e8164324fec5d225e4db3bbaf