Skip to content

Commit

Permalink
merged
Browse files Browse the repository at this point in the history
  • Loading branch information
flexatone committed Dec 6, 2023
2 parents 09fe67a + 9bb6e4f commit 19bc4a5
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 4 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/build-pyodide.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build PyOdide
on:
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@master
with:
python-version: 3.11.2
- run: |
pip install pyodide-build>=0.23.0
echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
- uses: mymindstorm/setup-emsdk@v12
with:
version: ${{ env.EMSCRIPTEN_VERSION }}
- run: pyodide build


- name: set up node
uses: actions/setup-node@master # v3.6.0
with:
node-version: ${{ env.NODE_VERSION }}

- name: Set up Pyodide virtual environment
run: |
pyodide venv .venv-pyodide
source .venv-pyodide/bin/activate
pip install dist/*.whl
pip install numpy
pip install pandas
pip install pytest
pip install hypothesis
- name: Test
run: |
source .venv-pyodide/bin/activate
pytest test
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-1

- name: Copy to AWS s3
run: |
aws s3 cp ./dist s3://flexatone/packages/ --exclude "*" --include "*.whl" --recursive
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,33 @@ jobs:
fail-fast: false
matrix:
os: [macos-12, ubuntu-22.04, windows-2022]
<<<<<<< HEAD
minor: [8]
=======
minor: [7, 8]
>>>>>>> master
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
<<<<<<< HEAD
- uses: pypa/[email protected]
=======
- uses: pypa/[email protected]
>>>>>>> master
with:
output-dir: dist
env:
CIBW_BUILD: cp3${{ matrix.minor }}-*
<<<<<<< HEAD
CIBW_ARCHS_MACOS: x86_64 universal2 arm64
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build-3_08.txt
CIBW_BEFORE_TEST: pip install -r {project}/requirements-dev-3_08.txt
=======
CIBW_ARCHS_MACOS: all
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build-backward.txt
CIBW_BEFORE_TEST: pip install -r {project}/requirements-test-backward.txt
>>>>>>> master
CIBW_TEST_COMMAND: pytest {project}

- uses: actions/upload-artifact@v3
Expand All @@ -59,11 +73,16 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
<<<<<<< HEAD
- uses: pypa/[email protected]
=======
- uses: pypa/[email protected]
>>>>>>> master
with:
output-dir: dist
env:
CIBW_BUILD: cp3${{ matrix.minor }}-*
<<<<<<< HEAD
CIBW_ARCHS_MACOS: x86_64 universal2 arm64
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build-3_11.txt
CIBW_BEFORE_TEST: pip install -r {project}/requirements-dev-3_11.txt
Expand Down Expand Up @@ -93,17 +112,46 @@ jobs:
CIBW_ARCHS_MACOS: x86_64 universal2 arm64
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build-3_12.txt
CIBW_BEFORE_TEST: pip install -r {project}/requirements-dev-3_12.txt
=======
CIBW_ARCHS_MACOS: all
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build.txt
CIBW_BEFORE_TEST: pip install -r {project}/requirements-test.txt
>>>>>>> master
CIBW_TEST_COMMAND: pytest {project}

- uses: actions/upload-artifact@v3
with:
name: dist
path: dist

forward:
name: Forward / ${{ matrix.os }} / Python 3.${{ matrix.minor }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
minor: [11]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pypa/[email protected]
with:
output-dir: dist
env:
CIBW_BUILD: cp3${{ matrix.minor }}-*
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build.txt
CIBW_BEFORE_TEST: pip install -r {project}/requirements-test-forward.txt
CIBW_TEST_COMMAND: pytest {project}

upload:
name: Publish
if: github.event_name == 'release' && github.event.action == 'published'
<<<<<<< HEAD
needs: [tar_gz, whl_3_8, whl_gte_3_9_to_3_11, whl_3_12]
=======
needs: [tar_gz, whl_lt_3_9, whl_gte_3_9, forward]
>>>>>>> master
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion arraymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# define PY_SSIZE_T_CLEAN
# include "Python.h"

# define PY_ARRAY_UNIQUE_SYMBOL AK_ARRAY_API
# define PY_ARRAY_UNIQUE_SYMBOL AM_ARRAY_API
# define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION

# include "numpy/arrayobject.h"
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev-3_08.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ hypothesis==6.70.0
invoke==1.7.1
pytest==7.1.2
tzdata==2022.1
numpy==1.19.5
numpy==1.19.5
7 changes: 7 additions & 0 deletions requirements-test-backward.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
black==22.3.0
hypothesis==6.70.0
invoke==1.7.1
pytest==7.1.2
tzdata==2022.1
numpy==1.19.5

5 changes: 5 additions & 0 deletions requirements-test-forward.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
black==22.3.0
hypothesis==6.70.0
invoke==1.7.1
pytest==7.1.2
numpy==1.24.3
5 changes: 5 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
black==22.3.0
hypothesis==6.70.0
invoke==1.7.1
pytest==7.1.2
numpy==1.23.5
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
numpy>=1.19.5

4 changes: 2 additions & 2 deletions test/test_property.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pickle
import typing
import typing as tp
from functools import partial
import sys
import warnings
Expand All @@ -17,7 +17,7 @@
from arraymap import FrozenAutoMap
from arraymap import NonUniqueError

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

NATIVE_BYTE_ORDER = "<" if sys.byteorder == "little" else ">"
VALID_BYTE_ORDERS = ("=", NATIVE_BYTE_ORDER)
Expand Down

0 comments on commit 19bc4a5

Please sign in to comment.