From c009fa3c5fd84a2929b6072e4501409100e3d108 Mon Sep 17 00:00:00 2001 From: Gene Hoffman <30377676+hoffmang9@users.noreply.github.com> Date: Sat, 8 Jan 2022 16:28:16 -0800 Subject: [PATCH] Build Python 3.9 and 3.10 M1 wheels (#304) * Build Python 3.9 and 3.10 M1 wheels * Find brew-python paths * Cancel-workflow to 0.9.1 - test Python 3.10 on Mac/Ubuntu (#303) * cancel-workflow to 0.9.1 - test Python 3.10 * Revert e73751e and change to single \ later * python is in /opt/homebrew * source not found * no dash in cp39, cp310 * use brew install instead * pip install delocate-wheel * $(brew --prefix python@3.9) * shorten path * path is already full * Update path and correct delocate install --- .github/workflows/build-m1-wheel.yml | 45 +++++++++++++++++++--------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-m1-wheel.yml b/.github/workflows/build-m1-wheel.yml index 06cc782df..6700e8d34 100644 --- a/.github/workflows/build-m1-wheel.yml +++ b/.github/workflows/build-m1-wheel.yml @@ -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: |