Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Python 3.9 and 3.10 M1 wheels #304

Merged
merged 12 commits into from Jan 9, 2022
2 changes: 1 addition & 1 deletion .github/workflows/build-aarch64.yml
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
- name: Cancel previous runs on the same branch
if: ${{ github.ref != 'refs/heads/main' }}
uses: styfle/cancel-workflow-action@0.7.0
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}

Expand Down
47 changes: 32 additions & 15 deletions .github/workflows/build-m1-wheel.yml
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- name: Cancel previous runs on the same branch
if: ${{ github.ref != 'refs/heads/main' }}
uses: styfle/cancel-workflow-action@0.7.0
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}

Expand All @@ -29,29 +29,46 @@ jobs:
with:
fetch-depth: 0

- name: Lint source with flake8
- name: Brew update Python
run: |
arch -arm64 python -m pip install --upgrade pip
arch -arm64 pip install flake8
arch -arm64 flake8 src setup.py python-bindings python-impl
arch -arm64 brew install python@3.9
arch -arm64 brew install python@3.10

- name: Lint source with mypy
run: |
arch -arm64 pip install mypy
arch -arm64 mypy --config-file mypi.ini python-bindings python-impl

- name: Build m1 wheels
- name: Build m1 wheels for 3.9 and 3.10
run: |
rm -rf venv
arch -arm64 $(brew --prefix python@3.9)/libexec/bin/python -m venv venv
. venv/bin/activate
arch -arm64 pip wheel -w dist --no-deps .
arch -arm64 pip install delocate
arch -arm64 delocate-wheel -v dist/*cp39*.whl
deactivate
rm -rf venv
arch -arm64 $(brew --prefix python@3.10)/libexec/bin/python -m venv venv
. venv/bin/activate
arch -arm64 pip wheel -w dist --no-deps .
arch -arm64 delocate-wheel -v dist/*.whl
arch -arm64 pip install delocate
arch -arm64 delocate-wheel -v dist/*cp310*.whl
deactivate
rm -rf venv

- name: Test wheel
run: |
arch -arm64 python3 -m venv venv
. ./venv/bin/activate
arch -arm64 pip install ./dist/*.whl
rm -rf venv
arch -arm64 $(brew --prefix python@3.9)/libexec/bin/python -m venv venv
. venv/bin/activate
arch -arm64 pip install ./dist/*cp39*.whl
arch -arm64 pip install pytest
arch -arm64 ./venv/bin/pytest -v ./python-bindings/test.py
deactivate
rm -rf venv
arch -arm64 $(brew --prefix python@3.10)/libexec/bin/python -m venv venv
. venv/bin/activate
arch -arm64 pip install ./dist/*cp310*.whl
arch -arm64 pip install pytest
arch -arm64 ./venv/bin/pytest -v ./python-bindings/test.py
deactivate
rm -rf venv

- name: Create sha256 hash
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-test.yaml
Expand Up @@ -18,12 +18,12 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
python: ['3.7', '3.8', '3.9']
python: ['3.7', '3.8', '3.9', '3.10']

steps:
- name: Cancel previous runs on the same branch
if: ${{ github.ref != 'refs/heads/main' }}
uses: styfle/cancel-workflow-action@0.7.0
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}

Expand Down Expand Up @@ -69,10 +69,10 @@ jobs:
- name: Test pure python implementation
run: |
python python-impl/impl-test.py

- name: Install emsdk
uses: mymindstorm/setup-emsdk@v9

- name: Test javascript bindings
run: |
emcc -v
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-wheels.yml
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
- name: Cancel previous runs on the same branch
if: ${{ github.ref != 'refs/heads/main' }}
uses: styfle/cancel-workflow-action@0.7.0
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/relic-nightly.yml
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- name: Cancel previous runs on the same branch
if: ${{ github.ref != 'refs/heads/main' }}
uses: styfle/cancel-workflow-action@0.7.0
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -176,7 +176,7 @@ def build_extensions(self):
opts.append("-fvisibility=hidden")
elif ct == "msvc":
if sys.version_info < (3, 9):
ver_flag = '/DVERSION_INFO=\\"%s\\"'
ver_flag = '/DVERSION_INFO=\"%s\"'
else:
ver_flag = '-DVERSION_INFO="%s"'
opts.append(ver_flag % self.distribution.get_version())
Expand Down