Skip to content
This repository was archived by the owner on Jun 27, 2025. It is now read-only.

Commit 9bb6e4f

Browse files
authored
Merge pull request #29 from static-frame/28/pyodide
2 parents 78afa62 + 51af192 commit 9bb6e4f

7 files changed

Lines changed: 92 additions & 15 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build PyOdide
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
build:
7+
name: Build
8+
runs-on: ubuntu-22.04
9+
steps:
10+
- uses: actions/checkout@master
11+
- uses: actions/setup-python@master
12+
with:
13+
python-version: 3.11.2
14+
- run: |
15+
pip install pyodide-build>=0.23.0
16+
echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
17+
- uses: mymindstorm/setup-emsdk@v12
18+
with:
19+
version: ${{ env.EMSCRIPTEN_VERSION }}
20+
- run: pyodide build
21+
22+
23+
- name: set up node
24+
uses: actions/setup-node@master # v3.6.0
25+
with:
26+
node-version: ${{ env.NODE_VERSION }}
27+
28+
- name: Set up Pyodide virtual environment
29+
run: |
30+
pyodide venv .venv-pyodide
31+
source .venv-pyodide/bin/activate
32+
pip install dist/*.whl
33+
pip install numpy
34+
pip install pandas
35+
pip install pytest
36+
pip install hypothesis
37+
38+
- name: Test
39+
run: |
40+
source .venv-pyodide/bin/activate
41+
pytest test
42+
43+
- name: Configure AWS credentials
44+
uses: aws-actions/configure-aws-credentials@v1
45+
with:
46+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
47+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
48+
aws-region: us-west-1
49+
50+
- name: Copy to AWS s3
51+
run: |
52+
aws s3 cp ./dist s3://flexatone/packages/ --exclude "*" --include "*.whl" --recursive
53+

.github/workflows/ci.yml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
os: [macos-12, ubuntu-20.04, windows-2022]
30+
os: [macos-12, ubuntu-22.04, windows-2022]
3131
minor: [7, 8]
3232
runs-on: ${{ matrix.os }}
3333
steps:
3434
- uses: actions/checkout@v3
3535
- uses: actions/setup-python@v3
36-
- uses: pypa/cibuildwheel@v2.12.3
36+
- uses: pypa/cibuildwheel@v2.13.0
3737
with:
3838
output-dir: dist
3939
env:
4040
CIBW_BUILD: cp3${{ matrix.minor }}-*
4141
CIBW_ARCHS_MACOS: all
4242
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build-backward.txt
43-
CIBW_BEFORE_TEST: pip install -r {project}/requirements-backward.txt
43+
CIBW_BEFORE_TEST: pip install -r {project}/requirements-test-backward.txt
4444
CIBW_TEST_COMMAND: pytest {project}
4545

4646
- uses: actions/upload-artifact@v3
@@ -53,31 +53,51 @@ jobs:
5353
strategy:
5454
fail-fast: false
5555
matrix:
56-
os: [macos-12, ubuntu-20.04, windows-2022]
56+
os: [macos-12, ubuntu-22.04, windows-2022]
5757
minor: [9, 10, 11]
5858
runs-on: ${{ matrix.os }}
5959
steps:
6060
- uses: actions/checkout@v3
6161
- uses: actions/setup-python@v3
62-
- uses: pypa/cibuildwheel@v2.12.3
62+
- uses: pypa/cibuildwheel@v2.13.0
6363
with:
6464
output-dir: dist
6565
env:
6666
CIBW_BUILD: cp3${{ matrix.minor }}-*
6767
CIBW_ARCHS_MACOS: all
6868
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build.txt
69-
CIBW_BEFORE_TEST: pip install -r {project}/requirements.txt
69+
CIBW_BEFORE_TEST: pip install -r {project}/requirements-test.txt
7070
CIBW_TEST_COMMAND: pytest {project}
7171

7272
- uses: actions/upload-artifact@v3
7373
with:
7474
name: dist
7575
path: dist
7676

77+
forward:
78+
name: Forward / ${{ matrix.os }} / Python 3.${{ matrix.minor }}
79+
strategy:
80+
fail-fast: false
81+
matrix:
82+
os: [ubuntu-22.04]
83+
minor: [11]
84+
runs-on: ${{ matrix.os }}
85+
steps:
86+
- uses: actions/checkout@v3
87+
- uses: actions/setup-python@v3
88+
- uses: pypa/cibuildwheel@v2.13.0
89+
with:
90+
output-dir: dist
91+
env:
92+
CIBW_BUILD: cp3${{ matrix.minor }}-*
93+
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build.txt
94+
CIBW_BEFORE_TEST: pip install -r {project}/requirements-test-forward.txt
95+
CIBW_TEST_COMMAND: pytest {project}
96+
7797
upload:
7898
name: Publish
7999
if: github.event_name == 'release' && github.event.action == 'published'
80-
needs: [tar_gz, whl_lt_3_9, whl_gte_3_9]
100+
needs: [tar_gz, whl_lt_3_9, whl_gte_3_9, forward]
81101
runs-on: ubuntu-latest
82102
steps:
83103
- uses: actions/download-artifact@v3
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ black==22.3.0
22
hypothesis==6.70.0
33
invoke==1.7.1
44
pytest==7.1.2
5-
tzdata==2022.1
65
numpy==1.18.5

requirements-test-forward.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
black==22.3.0
2+
hypothesis==6.70.0
3+
invoke==1.7.1
4+
pytest==7.1.2
5+
numpy==1.24.3

requirements-test.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
black==22.3.0
2+
hypothesis==6.70.0
3+
invoke==1.7.1
4+
pytest==7.1.2
5+
numpy==1.23.5

requirements.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
black==22.3.0
2-
hypothesis==6.70.0
3-
invoke==1.7.1
4-
pytest==7.1.2
5-
tzdata==2022.1
61
numpy==1.23.5

test/test_property.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pickle
2-
import typing
2+
import typing as tp
33
from functools import partial
44
import sys
55
import warnings
@@ -17,7 +17,7 @@
1717
from arraymap import FrozenAutoMap
1818
from arraymap import NonUniqueError
1919

20-
Keys = typing.Set[typing.Hashable]
20+
Keys = tp.Set[tp.Union[int, str, float, bool, bytes, tp.Tuple[int, ...]]]
2121

2222
NATIVE_BYTE_ORDER = "<" if sys.byteorder == "little" else ">"
2323
VALID_BYTE_ORDERS = ("=", NATIVE_BYTE_ORDER)

0 commit comments

Comments
 (0)