Skip to content

Commit

Permalink
Merge pull request #56 from PrimozGodec/build-arm
Browse files Browse the repository at this point in the history
Build macos ARM wheels and update the building workflow
  • Loading branch information
PrimozGodec committed Sep 15, 2023
2 parents 00248c8 + f44db1a commit 818768d
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 15 deletions.
54 changes: 41 additions & 13 deletions .github/workflows/build_wheels.yml
Expand Up @@ -8,28 +8,56 @@ on:
workflow_dispatch:

jobs:
generate-wheels-matrix:
# Create a matrix of all architectures & versions to build.
# This enables the next step to run cibuildwheel in parallel.
# From https://iscinumpy.dev/post/cibuildwheel-2-10-0/#only-210
name: Generate wheels matrix
runs-on: ubuntu-latest
outputs:
include: ${{ steps.set-matrix.outputs.include }}
steps:
- uses: actions/checkout@v3
- name: Install cibuildwheel
# Nb. keep cibuildwheel version pin consistent with job below
run: pipx install cibuildwheel==2.14.1
- id: set-matrix
run: |
MATRIX=$(
{
cibuildwheel --print-build-identifiers --platform linux \
| jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \
&& cibuildwheel --print-build-identifiers --platform macos \
| jq -nRc '{"only": inputs, "os": "macos-latest"}' \
&& cibuildwheel --print-build-identifiers --platform windows \
| jq -nRc '{"only": inputs, "os": "windows-latest"}'
} | jq -sc
)
echo "include=$MATRIX" >> $GITHUB_OUTPUT
build_wheels:
name: Build wheels on ${{ matrix.os }}
name: Build ${{ matrix.only }}
needs: generate-wheels-matrix
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macOS-10.15]
include: ${{ fromJson(needs.generate-wheels-matrix.outputs.include) }}

steps:
- name: Check out the repo
uses: actions/checkout@v2

# Used to host cibuildwheel
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==1.9.0
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: "cp27-* cp35-* pp*"
uses: pypa/cibuildwheel@v2.14.1
with:
only: ${{ matrix.only }}

- uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -61,6 +89,7 @@ jobs:
name: Upload Release Assets
needs: [build_wheels]
runs-on: ubuntu-20.04
if: startsWith(github.ref, 'refs/tags')

steps:
- name: Download bdist files
Expand All @@ -83,6 +112,7 @@ jobs:
name: PyPI Publish
needs: [build_wheels, build_sdist]
runs-on: ubuntu-20.04
if: startsWith(github.ref, 'refs/tags')

steps:
- name: Download bdist files
Expand All @@ -106,5 +136,3 @@ jobs:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: downloads/
# repository_url: https://test.pypi.org/legacy/
# verbose: true
2 changes: 1 addition & 1 deletion orangecontrib/associate/_fpgrowth.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions pyproject.toml
Expand Up @@ -4,3 +4,17 @@ requires = [
'wheel',
]
build-backend = 'setuptools.build_meta'

[tool.cibuildwheel]
# todo: skipping cp311 since _fpgrowth not compatible, fix it and then enalbe cp311
skip = ["cp36-*", "cp37-*", "cp38-*", "cp311-*", "pp*", "*-musllinux_*"]
build-verbosity = 2

[tool.cibuildwheel.linux]
archs = ["x86_64", "aarch64"]

[tool.cibuildwheel.windows]
archs = ["AMD64"]

[tool.cibuildwheel.macos]
archs = ["x86_64", "arm64"]
3 changes: 2 additions & 1 deletion setup.py
Expand Up @@ -77,7 +77,8 @@ def do_setup(ext_modules):
'Intended Audience :: Developers',
],
zip_safe=False,
include_package_data=True
include_package_data=True,
python_requires='>=3.9'
)


Expand Down

0 comments on commit 818768d

Please sign in to comment.