Skip to content

Commit

Permalink
initial github action test
Browse files Browse the repository at this point in the history
  • Loading branch information
joemarshall committed Aug 12, 2024
0 parents commit 1b26965
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/make_wheels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: main

on:
push:
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: read

jobs:
build:
strategy:
matrix:
include:
- pyodide: 0.27.3
python: 3.12
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: install pyodide build
run: pip install pyodide-build=${{ matrix.pyodide }}
- name: Get emscripten version
run: python -c 'from pyodide_build.build_env import emscripten_version;print(f"EMVERSION={emscripten_version()}")' >> $GITHUB_ENV
- name: Install emsdk ${{env.EMVERSION}}
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{env.EMVERSION}}
actions-cache-folder: 'emsdk-cache'
- run: mkdir dist
- name: Arrow build
run: pyodide build-recipe-no-deps --recipe-dir . --target-dir dist pyarrow
- uses: actions/upload-artifact@v4
with:
name: build_wheel
path: dist

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.pyodide*
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# PyArrow build for pyodide

This builds pyarrow wheels for use in pyodide. It is separate to the main pyodide build because pyarrow is a SLOW build.
55 changes: 55 additions & 0 deletions pyarrow/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package:
name: pyarrow
version: 17.0.0
top-level:
- pyarrow
source:
url: https://github.com/apache/arrow/releases/download/apache-arrow-17.0.0/apache-arrow-17.0.0.tar.gz
sha256: 9d280d8042e7cf526f8c28d170d93bfab65e50f94569f6a790982a878d8d898d
# extract_dir: arrow-57ac40ca23ebcaa4d42ae808137033689d3be9b1
patches:
- patches/autoload_timezones.patch
build:
script: |
# move things around so that the top level folder is the python folder
# with the pyproject.toml, so pyodide build works
cd ..
# build libarrow as static library without the pyodide toolchain file
# because that does bad things to the build
BACKUP_TOOLCHAIN=${CMAKE_TOOLCHAIN_FILE}
unset CMAKE_TOOLCHAIN_FILE
if [ ! -d "${PKG_BUILD_DIR}_cpp" ]; then
mv $PKG_BUILD_DIR ${PKG_BUILD_DIR}_cpp
cp -r ${PKG_BUILD_DIR}_cpp/python $PKG_BUILD_DIR
# build arrow cpp library and install to emscripten sysroot
# n.b. the if statements below mean that you can call pyodide build-packages-no-deps
# pyarrow --continue to debug build errors without having to do a full rebuild
mkdir cppbuild
cd cppbuild
emcmake cmake --preset ninja-release-emscripten ${PKG_BUILD_DIR}_cpp/cpp
else
cd cppbuild
fi
cmake --build . --target=protobuf_ep_host -j 4
cmake --build . --target=install -j 4
cd ${PKG_BUILD_DIR}
export CMAKE_TOOLCHAIN_FILE=${BACKUP_TOOLCHAIN}
rm -f CMakeCache.txt
rm -rf CMakeFiles
cross-script: |
cmake --version
about:
home: https://arrow.apache.org/
PyPI: https://pypi.org/project/pyarrow
summary: Python library for Apache Arrow
license: Apache License, Version 2.0
requirements:
run:
- numpy
- pandas
- pyodide-unix-timezones
host:
- numpy
extra:
recipe-maintainers:
- joemarshall
13 changes: 13 additions & 0 deletions pyarrow/patches/autoload_timezones.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/python/pyarrow/__init__.py.orig b/python/pyarrow/__init__.py
index e52e0d24..9982f41c 100644
--- a/python/pyarrow/__init__.py
+++ b/python/pyarrow/__init__.py
@@ -28,7 +28,7 @@ streaming messaging and interprocess communication.

For more information see the official page at https://arrow.apache.org
"""
-
+import unix_timezones
import gc as _gc
import importlib as _importlib
import os as _os
6 changes: 6 additions & 0 deletions scripts/get_pyodide_versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -e

PACKAGE_JSON_URL="https://pypi.org/pypi/pyodide-build/json"

wget --no-check-certificate "$PACKAGE_JSON_URL" -O- | jq -r '.releases | keys | .[]' |sort -V

0 comments on commit 1b26965

Please sign in to comment.