-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Polars build for Pyodide (#20383)
Co-authored-by: ritchie <[email protected]>
- Loading branch information
1 parent
e074e1a
commit 530e70a
Showing
29 changed files
with
393 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Test Pyodide | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- Cargo.lock | ||
- py-polars/** | ||
- docs/source/src/python/** | ||
- crates/** | ||
- .github/workflows/test-pyodide.yml | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- Cargo.lock | ||
- crates/** | ||
- docs/source/src/python/** | ||
- py-polars/** | ||
- .github/workflows/test-pyodide.yml | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
RUSTFLAGS: -C link-self-contained=no -C debuginfo=0 | ||
CFLAGS: -fPIC | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
test-pyodide: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Disable incompatible features | ||
env: | ||
FEATURES: parquet|async|json|extract_jsonpath|cloud|polars_cloud|tokio|clipboard|decompress|new_streaming | ||
run: | | ||
sed -i 's/^ "json",$/ "serde_json",/' crates/polars-python/Cargo.toml | ||
sed -E -i "/^ \"(${FEATURES})\",$/d" crates/polars-python/Cargo.toml py-polars/Cargo.toml | ||
- name: Setup emsdk | ||
uses: mymindstorm/setup-emsdk@v14 | ||
with: | ||
# This should match the exact version of Emscripten used by Pyodide | ||
version: 3.1.58 | ||
|
||
- name: Install LLVM | ||
# This should match the major version of LLVM expected by Emscripten | ||
run: | | ||
wget https://apt.llvm.org/llvm.sh | ||
chmod +x llvm.sh | ||
sudo ./llvm.sh 19 | ||
echo "EM_LLVM_ROOT=/usr/lib/llvm-19/bin" >> $GITHUB_ENV | ||
- name: Build wheel | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
command: build | ||
target: wasm32-unknown-emscripten | ||
args: > | ||
--profile dev | ||
--manifest-path py-polars/Cargo.toml | ||
--interpreter python3.10 | ||
maturin-version: 1.7.4 |
Oops, something went wrong.