From 31f38eb567c914b2845d6ed26d2f10a64324bd0c Mon Sep 17 00:00:00 2001 From: Gene Hoffman <30377676+hoffmang9@users.noreply.github.com> Date: Fri, 5 Feb 2021 22:27:47 -0800 Subject: [PATCH] Build MacOS ARM64 Universal wheels (#161) * Try MacOS ARM wheels * Only macos universal - try QEMU aarch64 build * Comment out QEMU arm64 builds * Re-order for consistency, clean --- .github/workflows/build-aarch64.yml | 25 ++++---- .github/workflows/build-test-cplusplus.yml | 3 - .github/workflows/build-wheels.yml | 70 ++++++++++++++------- .github/workflows/doc-html-pdf.yml | 13 ---- .github/workflows/plot-k27-no-bitfield.yaml | 13 ---- .github/workflows/plot-k27.yaml | 13 ---- 6 files changed, 59 insertions(+), 78 deletions(-) diff --git a/.github/workflows/build-aarch64.yml b/.github/workflows/build-aarch64.yml index 909985c39..25ef07b16 100644 --- a/.github/workflows/build-aarch64.yml +++ b/.github/workflows/build-aarch64.yml @@ -20,19 +20,6 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - with: - fetch-depth: 0 - # we need fetch-depth 0 so setuptools_scm can resolve tags - - - name: Test for secrets access - id: check_secrets - shell: bash - run: | - unset HAS_SECRET - if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi - echo ::set-output name=HAS_SECRET::${HAS_SECRET} - env: - SECRET: "${{ secrets.test_pypi_password }}" - name: Prepare cibuildwheel run: | @@ -42,7 +29,7 @@ jobs: source venv/bin/activate python -m pip install --upgrade pip pip install wheel - pip install cibuildwheel==1.8.0 + pip install cibuildwheel==1.9.0 - name: Lint source with flake8 run: | @@ -84,6 +71,16 @@ jobs: name: wheels path: ./dist + - name: Test for secrets access + id: check_secrets + shell: bash + run: | + unset HAS_SECRET + if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi + echo ::set-output name=HAS_SECRET::${HAS_SECRET} + env: + SECRET: "${{ secrets.test_pypi_password }}" + - name: Install twine run: | source venv/bin/activate diff --git a/.github/workflows/build-test-cplusplus.yml b/.github/workflows/build-test-cplusplus.yml index cf8a5f83d..cd4dfa3fe 100644 --- a/.github/workflows/build-test-cplusplus.yml +++ b/.github/workflows/build-test-cplusplus.yml @@ -20,9 +20,6 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - with: - fetch-depth: 0 - # we need fetch-depth 0 so setuptools_scm can resolve tags - name: cmake, RunTests with Windows if: startsWith(matrix.os, 'windows') diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 1f82aa0d8..66021a933 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -20,33 +20,15 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - with: - fetch-depth: 0 - # we need fetch-depth 0 so setuptools_scm can resolve tags - uses: actions/setup-python@v2 name: Install Python with: python-version: '3.8' - - name: Test for secrets access - id: check_secrets - shell: bash - run: | - unset HAS_SECRET - if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi - echo ::set-output name=HAS_SECRET::${HAS_SECRET} - env: - SECRET: "${{ secrets.test_pypi_password }}" - - - name: Install cibuildwheel - run: | - python -m pip install --upgrade pip - pip install wheel - pip install cibuildwheel==1.8.0 - - name: Lint source with flake8 run: | + python -m pip install --upgrade pip pip install flake8 flake8 tests setup.py @@ -61,14 +43,18 @@ jobs: pip install build python -m build --sdist --outdir dist . - - name: Build wheels and test - run: | - python -m cibuildwheel --output-dir dist + - name: Build ${{ matrix.os }} wheels and test + uses: joerick/cibuildwheel@v1.9.0 + with: + output-dir: dist env: # build python 3.7 and 3.8 CIBW_BUILD: 'cp37-* cp38-* cp39-*' CIBW_SKIP: '*-manylinux_i686 *-win32' # we need boost + # CIBW_ARCHS_MACOS: x86_64 arm64 universal2 + CIBW_ARCHS_MACOS: x86_64 universal2 + CIBW_TEST_SKIP: '*_arm64 *_universal2:arm64' CIBW_BUILD_VERBOSITY_LINUX: 0 CIBW_BUILD_VERBOSITY_MACOS: 0 CIBW_BUILD_VERBOSITY_WINDOWS: 0 @@ -89,12 +75,52 @@ jobs: CIBW_TEST_REQUIRES: pytest CIBW_TEST_COMMAND: py.test -v {project}/tests -s +# - name: Set up QEMU on ubuntu x86_64 +# if: startsWith(matrix.os, 'ubuntu') +# id: qemu +# uses: docker/setup-qemu-action@v1 +# with: +# platforms: arm64 +# QEMY is about 9x slower than ARM64 native builds sadly... +# - name: Build wheels and test aarch64 +# if: startsWith(matrix.os, 'ubuntu') +# uses: joerick/cibuildwheel@v1.9.0 +# with: +# output-dir: dist +# env: +# CIBW_BUILD: 'cp37-* cp38-* cp39-*' +# CIBW_ARCHS_LINUX: aarch64 +# CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 +# CIBW_BUILD_VERBOSITY_LINUX: 0 +# # we need boost +# CIBW_BEFORE_ALL_LINUX: > +# yum -y install epel-release +# && yum -y install cmake3 +# && rm -rf /usr/local/bin/cmake +# && ln -s /usr/bin/cmake3 /usr/local/bin/cmake +# && cmake --version +# && uname -a +# CIBW_BEFORE_BUILD_LINUX: > +# python -m pip install --upgrade pip +# CIBW_TEST_REQUIRES: pytest +# CIBW_TEST_COMMAND: py.test -v {project}/tests -s + - name: Upload wheels uses: actions/upload-artifact@v2 with: name: wheels path: ./dist + - name: Test for secrets access + id: check_secrets + shell: bash + run: | + unset HAS_SECRET + if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi + echo ::set-output name=HAS_SECRET::${HAS_SECRET} + env: + SECRET: "${{ secrets.test_pypi_password }}" + - name: Install twine run: pip install twine diff --git a/.github/workflows/doc-html-pdf.yml b/.github/workflows/doc-html-pdf.yml index d3b469563..381cdf1c2 100644 --- a/.github/workflows/doc-html-pdf.yml +++ b/.github/workflows/doc-html-pdf.yml @@ -20,9 +20,6 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - with: - fetch-depth: 0 - # we need fetch-depth 0 so setuptools_scm can resolve tags - uses: actions/setup-python@v2 name: Install Python @@ -39,16 +36,6 @@ jobs: pip install python-markdown-math # python -m markdown -x mdx_math --verbose -f proof_of_space.html proof_of_space.md -# - name: Test for secrets access -# id: check_secrets -# shell: bash -# run: | -# unset HAS_SECRET -# if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi -# echo ::set-output name=HAS_SECRET::${HAS_SECRET} -# env: -# SECRET: "${{ secrets.test_pypi_password }}" - - name: html to pdf uses: fifsky/html-to-pdf-action@master with: diff --git a/.github/workflows/plot-k27-no-bitfield.yaml b/.github/workflows/plot-k27-no-bitfield.yaml index 7172bd972..f16183221 100644 --- a/.github/workflows/plot-k27-no-bitfield.yaml +++ b/.github/workflows/plot-k27-no-bitfield.yaml @@ -20,19 +20,6 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - with: - fetch-depth: 0 - # we need fetch-depth 0 so setuptools_scm can resolve tags - - - name: Test for secrets access - id: check_secrets - shell: bash - run: | - unset HAS_SECRET - if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi - echo ::set-output name=HAS_SECRET::${HAS_SECRET} - env: - SECRET: "${{ secrets.test_pypi_password }}" - uses: actions/setup-python@v2 name: Install Python diff --git a/.github/workflows/plot-k27.yaml b/.github/workflows/plot-k27.yaml index 2db6b3bf1..676624894 100644 --- a/.github/workflows/plot-k27.yaml +++ b/.github/workflows/plot-k27.yaml @@ -20,19 +20,6 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - with: - fetch-depth: 0 - # we need fetch-depth 0 so setuptools_scm can resolve tags - - - name: Test for secrets access - id: check_secrets - shell: bash - run: | - unset HAS_SECRET - if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi - echo ::set-output name=HAS_SECRET::${HAS_SECRET} - env: - SECRET: "${{ secrets.test_pypi_password }}" - uses: actions/setup-python@v2 name: Install Python