From 6b3e0b4df430dc2550f97e75f1b8fb96f1afbc3b Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Thu, 9 May 2024 02:38:02 +0530 Subject: [PATCH 01/19] BLD: Add note about keeping jobs in sync --- .github/workflows/unit-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 1b88d4d90d3e1..aaa6153c04615 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -347,6 +347,7 @@ jobs: - name: Run Tests uses: ./.github/actions/run-tests + # NOTE: this job must be kept in sync with the Pyodide build job in wheels.yml emscripten: # Note: the Python version, Emscripten toolchain version are determined # by the Pyodide version. The appropriate versions can be found in the From 9833af6abe0133499d003a484bfd920de66c2e88 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Thu, 9 May 2024 02:39:41 +0530 Subject: [PATCH 02/19] BLD, CI: Upload Emscripten wheels nightly to Anaconda --- .github/workflows/wheels.yml | 58 ++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index d7a98671c42bc..33383c8806169 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -199,3 +199,61 @@ jobs: source ci/upload_wheels.sh set_upload_vars upload_wheels + + # Build Pyodide wheels and upload them to Anaconda.org + # NOTE: this job must be kept in sync with the emscripten job in unit-tests.yml. + # The difference is that this does not run the tests after building the wheels. + build_pyodide_wheels: + name: Build Pyodide wheels + # Run on schedule, manual (workflow dispatch), and push events + # Skip on PRs, because these are running in the unit tests job already + if: >- + (github.event_name == 'schedule') || + (github.event_name == 'workflow_dispatch') && + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0'))) + runs-on: ubuntu-22.04 + steps: + - name: Checkout pandas Repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python for Pyodide + id: setup-python + uses: actions/setup-python@v5 + with: + python-version: '3.11.3' + + - name: Set up Emscripten toolchain + uses: mymindstorm/setup-emsdk@v14 + with: + version: '3.1.46' + actions-cache-folder: emsdk-cache + + - name: Install pyodide-build + run: pip install "pyodide-build==0.25.1" + + - name: Build pandas for Pyodide + # Here, upload_wheels.sh requires artifacts to be in ./wheelhouse/ + run: | + mkdir -p wheelhouse + pyodide build --outdir wheelhouse + + - uses: actions/upload-artifact@v4 + with: + name: pyodide_wheel + path: ./wheelhouse/*.whl + + - name: Upload Pyodide wheels + if: >- + success() && + (github.event_name == 'schedule') || + (github.event_name == 'workflow_dispatch') && + (github.repository == 'pandas-dev/pandas') + shell: bash -el {0} + env: + PANDAS_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN }} + run: | + source ci/upload_wheels.sh + set_upload_vars + upload_wheels From 856904de85e92153a49b04db305483f744aedbf7 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Fri, 31 May 2024 00:18:02 +0530 Subject: [PATCH 03/19] Add configuration for `cibuildwheel`-Pyodide --- pyproject.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index e7d7474134c3a..bebd493b9e7f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -156,6 +156,13 @@ test-command = """ pd.test(extra_args=["-m not clipboard and single_cpu and not slow and not network and not db", "--no-strict-data-files"]);' \ """ +[tool.cibuildwheel.pyodide] +test-requires = "pytest>=7.3.2 hypothesis>=6.46.1" +test-command = """ + PANDAS_CI='1' python -c 'import pandas as pd; \ + pd.test(extra_args=["-m not clipboard and single_cpu and not slow and not network and not db", "--no-strict-data-files"]);' \ + """ + [tool.cibuildwheel.windows] before-build = "pip install delvewheel" repair-wheel-command = "delvewheel repair -w {dest_dir} {wheel}" From 7b3b68cfbea82793667f8373fa5febf0bdba99ad Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Fri, 31 May 2024 00:18:48 +0530 Subject: [PATCH 04/19] Use unreleased `cibuildwheel` in wheels CI job --- .github/workflows/wheels.yml | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 33383c8806169..60cc3f8c4f88c 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -201,8 +201,9 @@ jobs: upload_wheels # Build Pyodide wheels and upload them to Anaconda.org - # NOTE: this job must be kept in sync with the emscripten job in unit-tests.yml. - # The difference is that this does not run the tests after building the wheels. + # NOTE: this job is similar to the one in unit-tests.yml except for that fact + # that this does not run the tests after building the wheels and uses cibuildwheel + # instead of a regular Pyodide setup. build_pyodide_wheels: name: Build Pyodide wheels # Run on schedule, manual (workflow dispatch), and push events @@ -222,22 +223,14 @@ jobs: id: setup-python uses: actions/setup-python@v5 with: - python-version: '3.11.3' + python-version: '3.12' - - name: Set up Emscripten toolchain - uses: mymindstorm/setup-emsdk@v14 + - name: Build WASM wheel for pandas + uses: pypa/cibuildwheel@main with: - version: '3.1.46' - actions-cache-folder: emsdk-cache - - - name: Install pyodide-build - run: pip install "pyodide-build==0.25.1" - - - name: Build pandas for Pyodide - # Here, upload_wheels.sh requires artifacts to be in ./wheelhouse/ - run: | - mkdir -p wheelhouse - pyodide build --outdir wheelhouse + output-dir: ./wheelhouse + env: + CIBW_PLATFORM: pyodide - uses: actions/upload-artifact@v4 with: From fc6c327c0ad6db7244039fc647e41dbd980ac8e8 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Fri, 31 May 2024 00:42:56 +0530 Subject: [PATCH 05/19] Temporarily move config from TOML to env vars --- .github/workflows/wheels.yml | 14 ++++++++++---- pyproject.toml | 14 ++++++++------ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 60cc3f8c4f88c..caac4d2a25da3 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -208,10 +208,13 @@ jobs: name: Build Pyodide wheels # Run on schedule, manual (workflow dispatch), and push events # Skip on PRs, because these are running in the unit tests job already - if: >- - (github.event_name == 'schedule') || - (github.event_name == 'workflow_dispatch') && - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0'))) + + # TODO: Uncomment the following condition(s) when this PR is ready to be merged + # if: >- + # (github.event_name == 'schedule') || + # (github.event_name == 'workflow_dispatch') && + # (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0'))) + runs-on: ubuntu-22.04 steps: - name: Checkout pandas Repo @@ -231,6 +234,9 @@ jobs: output-dir: ./wheelhouse env: CIBW_PLATFORM: pyodide + CIBW_TEST_REQUIRES: pytest>=7.3.2 hypothesis>=6.46.1 + CIBW_TEST_COMMAND: | + PANDAS_CI=1 python -c 'import pandas as pd; pd.test(extra_args=["-m not clipboard and not single_cpu and not slow and not network and not db", "--no-strict-data-files"])' - uses: actions/upload-artifact@v4 with: diff --git a/pyproject.toml b/pyproject.toml index bebd493b9e7f6..c566c210d8fb2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -156,12 +156,14 @@ test-command = """ pd.test(extra_args=["-m not clipboard and single_cpu and not slow and not network and not db", "--no-strict-data-files"]);' \ """ -[tool.cibuildwheel.pyodide] -test-requires = "pytest>=7.3.2 hypothesis>=6.46.1" -test-command = """ - PANDAS_CI='1' python -c 'import pandas as pd; \ - pd.test(extra_args=["-m not clipboard and single_cpu and not slow and not network and not db", "--no-strict-data-files"]);' \ - """ +# Commented out for now and environment variables are being used instead +# because this feature is not yet there in a stable cibuildwheel release +# [tool.cibuildwheel.pyodide] +# test-requires = "pytest>=7.3.2 hypothesis>=6.46.1" +# test-command = """ +# PANDAS_CI='1' python -c 'import pandas as pd; \ +# pd.test(extra_args=["-m not clipboard and single_cpu and not slow and not network and not db", "--no-strict-data-files"]);' \ +# """ [tool.cibuildwheel.windows] before-build = "pip install delvewheel" From 8628801f756570d65f7d0593f054b54bafbf70db Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Fri, 31 May 2024 01:09:51 +0530 Subject: [PATCH 06/19] Rename job, to match update comment --- .github/workflows/wheels.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index caac4d2a25da3..50f4a99324ae3 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -201,11 +201,10 @@ jobs: upload_wheels # Build Pyodide wheels and upload them to Anaconda.org - # NOTE: this job is similar to the one in unit-tests.yml except for that fact - # that this does not run the tests after building the wheels and uses cibuildwheel - # instead of a regular Pyodide setup. + # NOTE: this job is similar to the one in unit-tests.yml except for the fact + # that it uses cibuildwheel instead of a standard Pyodide xbuildenv setup. build_pyodide_wheels: - name: Build Pyodide wheels + name: Build wheel for cp312-pyodide_wasm32 # Run on schedule, manual (workflow dispatch), and push events # Skip on PRs, because these are running in the unit tests job already From 6eb56d81bf4a4f3e2b29353891c442f343ff538e Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Sat, 8 Jun 2024 15:42:33 +0530 Subject: [PATCH 07/19] Try out Pyodide 0.26.1 From f5fc8d72d1280db78ca37e566ab0f5a7ac4e539f Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 11 Jun 2024 19:10:26 +0530 Subject: [PATCH 08/19] Move Pyodide configuration to `pyproject.toml` --- pyproject.toml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c566c210d8fb2..938aae7ff55de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -156,15 +156,6 @@ test-command = """ pd.test(extra_args=["-m not clipboard and single_cpu and not slow and not network and not db", "--no-strict-data-files"]);' \ """ -# Commented out for now and environment variables are being used instead -# because this feature is not yet there in a stable cibuildwheel release -# [tool.cibuildwheel.pyodide] -# test-requires = "pytest>=7.3.2 hypothesis>=6.46.1" -# test-command = """ -# PANDAS_CI='1' python -c 'import pandas as pd; \ -# pd.test(extra_args=["-m not clipboard and single_cpu and not slow and not network and not db", "--no-strict-data-files"]);' \ -# """ - [tool.cibuildwheel.windows] before-build = "pip install delvewheel" repair-wheel-command = "delvewheel repair -w {dest_dir} {wheel}" @@ -187,6 +178,16 @@ test-command = "" select = "*-macosx*" environment = {CFLAGS="-g0"} +[[tool.cibuildwheel.overrides]] +select = "*pyodide*" +test-requires = "pytest>=7.3.2 hypothesis>=6.46.1" +# Pyodide repairs wheels on its own, using auditwheel-emscripten +repair-wheel-command = "" +test-command = """ + PANDAS_CI='1' python -c 'import pandas as pd; \ + pd.test(extra_args=["-m not clipboard and single_cpu and not slow and not network and not db", "--no-strict-data-files"]);' \ + """ + [tool.ruff] line-length = 88 target-version = "py310" From df24ce9f747691c81d61f02d46b775b8d1b7df59 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 11 Jun 2024 19:10:54 +0530 Subject: [PATCH 09/19] Use cibuildwheel v2.19 + clean up workflow --- .github/workflows/wheels.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 50f4a99324ae3..7e03fe23cfb47 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -221,6 +221,8 @@ jobs: with: fetch-depth: 0 + # Note: Pyodide 0.26.0 is supported with Python 3.12. For more information, see + # https://github.com/pyodide/pyodide/blob/main/Makefile.envs - name: Set up Python for Pyodide id: setup-python uses: actions/setup-python@v5 @@ -228,14 +230,11 @@ jobs: python-version: '3.12' - name: Build WASM wheel for pandas - uses: pypa/cibuildwheel@main + uses: pypa/cibuildwheel@v2.19.0 with: output-dir: ./wheelhouse env: CIBW_PLATFORM: pyodide - CIBW_TEST_REQUIRES: pytest>=7.3.2 hypothesis>=6.46.1 - CIBW_TEST_COMMAND: | - PANDAS_CI=1 python -c 'import pandas as pd; pd.test(extra_args=["-m not clipboard and not single_cpu and not slow and not network and not db", "--no-strict-data-files"])' - uses: actions/upload-artifact@v4 with: From d6e4259fe98a4b29fb816ccf9f99210e1ec56349 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 11 Jun 2024 19:55:38 +0530 Subject: [PATCH 10/19] Skip a test that uses subprocesses --- pandas/tests/test_common.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandas/tests/test_common.py b/pandas/tests/test_common.py index bcecd1b2d5eec..53b730cfd9b6e 100644 --- a/pandas/tests/test_common.py +++ b/pandas/tests/test_common.py @@ -8,6 +8,8 @@ import numpy as np import pytest +from pandas.compat import WASM + import pandas as pd from pandas import Series import pandas._testing as tm @@ -234,6 +236,7 @@ def test_temp_setattr(with_exception): assert ser.name == "first" +@pytest.mark.skipif(WASM, reason="Can't start subprocesses in WASM") @pytest.mark.single_cpu def test_str_size(): # GH#21758 From 5aa5401db36afbc4348c01942e6bef2a072eff08 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 11 Jun 2024 19:58:15 +0530 Subject: [PATCH 11/19] Match tests args with other Pyodide tests; use `not single_cpu` --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 938aae7ff55de..d8a59ca2241a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -185,7 +185,7 @@ test-requires = "pytest>=7.3.2 hypothesis>=6.46.1" repair-wheel-command = "" test-command = """ PANDAS_CI='1' python -c 'import pandas as pd; \ - pd.test(extra_args=["-m not clipboard and single_cpu and not slow and not network and not db", "--no-strict-data-files"]);' \ + pd.test(extra_args=["-m not clipboard and not single_cpu and not slow and not network and not db", "--no-strict-data-files"]);' \ """ [tool.ruff] From e25d62da9643ce865fc1e5efb9e5fcb092b536b8 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Thu, 13 Jun 2024 16:04:48 +0530 Subject: [PATCH 12/19] Bump to cibuildwheel version 2.19.1 --- .github/workflows/wheels.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 7e03fe23cfb47..2403574d94681 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -221,16 +221,8 @@ jobs: with: fetch-depth: 0 - # Note: Pyodide 0.26.0 is supported with Python 3.12. For more information, see - # https://github.com/pyodide/pyodide/blob/main/Makefile.envs - - name: Set up Python for Pyodide - id: setup-python - uses: actions/setup-python@v5 - with: - python-version: '3.12' - - name: Build WASM wheel for pandas - uses: pypa/cibuildwheel@v2.19.0 + uses: pypa/cibuildwheel@v2.19.1 with: output-dir: ./wheelhouse env: From 3fb08328d4bac43f8b7f78e65ab35fa0b7772163 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Wed, 10 Jul 2024 22:38:24 +0530 Subject: [PATCH 13/19] Don't add `cp312` in job name Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> --- .github/workflows/wheels.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 260a2f3774fbb..b1fa4faf4a548 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -204,7 +204,8 @@ jobs: # NOTE: this job is similar to the one in unit-tests.yml except for the fact # that it uses cibuildwheel instead of a standard Pyodide xbuildenv setup. build_pyodide_wheels: - name: Build wheel for cp312-pyodide_wasm32 + name: Build wheel for pyodide_wasm32 + # Run on schedule, manual (workflow dispatch), and push events # Skip on PRs, because these are running in the unit tests job already From 10007f0e0c23345ac2f0d4d8c837cdc71a925fcc Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Fri, 12 Jul 2024 13:35:46 +0530 Subject: [PATCH 14/19] Don't use separate job for Pyodide wheels --- .github/workflows/wheels.yml | 55 +++++------------------------------- 1 file changed, 7 insertions(+), 48 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b1fa4faf4a548..34c4794114833 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -100,6 +100,13 @@ jobs: - [windows-2022, win_amd64] # TODO: support PyPy? python: [["cp310", "3.10"], ["cp311", "3.11"], ["cp312", "3.12"]] + + # Build Pyodide wheels and upload them to Anaconda.org + # NOTE: this job is similar to the one in unit-tests.yml except for the fact + # that it uses cibuildwheel instead of a standard Pyodide xbuildenv setup. + include: + - buildplat: [ubuntu-22.04, pyodide_wasm32] + - python: ["cp312", "3.12"] env: IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }} IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} @@ -199,51 +206,3 @@ jobs: source ci/upload_wheels.sh set_upload_vars upload_wheels - - # Build Pyodide wheels and upload them to Anaconda.org - # NOTE: this job is similar to the one in unit-tests.yml except for the fact - # that it uses cibuildwheel instead of a standard Pyodide xbuildenv setup. - build_pyodide_wheels: - name: Build wheel for pyodide_wasm32 - - # Run on schedule, manual (workflow dispatch), and push events - # Skip on PRs, because these are running in the unit tests job already - - # TODO: Uncomment the following condition(s) when this PR is ready to be merged - # if: >- - # (github.event_name == 'schedule') || - # (github.event_name == 'workflow_dispatch') && - # (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0'))) - - runs-on: ubuntu-22.04 - steps: - - name: Checkout pandas Repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Build WASM wheel for pandas - uses: pypa/cibuildwheel@v2.19.1 - with: - output-dir: ./wheelhouse - env: - CIBW_PLATFORM: pyodide - - - uses: actions/upload-artifact@v4 - with: - name: pyodide_wheel - path: ./wheelhouse/*.whl - - - name: Upload Pyodide wheels - if: >- - success() && - (github.event_name == 'schedule') || - (github.event_name == 'workflow_dispatch') && - (github.repository == 'pandas-dev/pandas') - shell: bash -el {0} - env: - PANDAS_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN }} - run: | - source ci/upload_wheels.sh - set_upload_vars - upload_wheels From 57913d8e3158cc81f82a5d923f5887e5c01b86cc Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Fri, 12 Jul 2024 13:41:50 +0530 Subject: [PATCH 15/19] Fix matrix inclusion --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 34c4794114833..467edb8d98f11 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -106,7 +106,7 @@ jobs: # that it uses cibuildwheel instead of a standard Pyodide xbuildenv setup. include: - buildplat: [ubuntu-22.04, pyodide_wasm32] - - python: ["cp312", "3.12"] + python: ["cp312", "3.12"] env: IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }} IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} From 099ed28f4910327d36eb8b2ed8638c7ee8e7a058 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Fri, 12 Jul 2024 14:10:38 +0530 Subject: [PATCH 16/19] Add separate step, set `CIBW_PLATFORM` to Pyodide --- .github/workflows/wheels.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 467edb8d98f11..4e1362ee1e1d1 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -154,6 +154,15 @@ jobs: CIBW_PRERELEASE_PYTHONS: True CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }} + - name: Build wheels (Pyodide) + uses: pypa/cibuildwheel@v2.19.2 + with: + package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }} + if: ${{ matrix.buildplat[1] == 'pyodide_wasm32' }} + env: + CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }} + CIBW_PLATFORM: pyodide + - name: Set up Python uses: mamba-org/setup-micromamba@v1 with: From 04cee9a1cea29ca511fc663af1295e36b9b59db1 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Fri, 12 Jul 2024 14:56:06 +0530 Subject: [PATCH 17/19] Add condition for non-Pyodide jobs --- .github/workflows/wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 4e1362ee1e1d1..75db73b5d1f0f 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -150,6 +150,7 @@ jobs: uses: pypa/cibuildwheel@v2.19.2 with: package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }} + if: ${{ matrix.buildplat[1] != 'pyodide_wasm32' }} env: CIBW_PRERELEASE_PYTHONS: True CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }} From 8779d8717a55325675806130e9122cc82276c7ac Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Fri, 12 Jul 2024 23:23:42 +0530 Subject: [PATCH 18/19] Use just one step, inherit `CIBW_PLATFORM` if not set Co-Authored-By: Thomas Li <47963215+lithomas1@users.noreply.github.com> --- .github/workflows/wheels.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 75db73b5d1f0f..fe4dd90ae7505 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -154,15 +154,7 @@ jobs: env: CIBW_PRERELEASE_PYTHONS: True CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }} - - - name: Build wheels (Pyodide) - uses: pypa/cibuildwheel@v2.19.2 - with: - package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }} - if: ${{ matrix.buildplat[1] == 'pyodide_wasm32' }} - env: - CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }} - CIBW_PLATFORM: pyodide + CIBW_PLATFORM: ${{ matrix.buildplat[1] == 'pyodide_wasm32' && 'pyodide' || 'auto' }} - name: Set up Python uses: mamba-org/setup-micromamba@v1 From 5106edd8800b8b43028980cd4cb49d2d3ce1ae89 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Fri, 12 Jul 2024 23:27:25 +0530 Subject: [PATCH 19/19] Remove condition that skips the step Co-Authored-By: Thomas Li <47963215+lithomas1@users.noreply.github.com> --- .github/workflows/wheels.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index fe4dd90ae7505..02100648b636a 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -150,7 +150,6 @@ jobs: uses: pypa/cibuildwheel@v2.19.2 with: package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }} - if: ${{ matrix.buildplat[1] != 'pyodide_wasm32' }} env: CIBW_PRERELEASE_PYTHONS: True CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}