Skip to content

Commit

Permalink
Modernize cibuildwheel configuration.
Browse files Browse the repository at this point in the history
Build and test macos-arm64 packages natively.
  • Loading branch information
joaander committed May 23, 2024
1 parent 8482a93 commit 0f92e41
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/build_wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,45 @@ env:

jobs:
build_wheels:
name: Build wheels [py${{ matrix.python_version }}, ${{ matrix.os }}]
runs-on: ${{ matrix.os }}-${{ matrix.os_version }}
name: Build wheels [${{ matrix.python }}, ${{ matrix.os.base }}-${{ matrix.os.arch }}]
runs-on: ${{ matrix.os.base }}-${{ matrix.os.version }}
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows, macos]
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

include:
- os_version: 'latest'
os:
- base: ubuntu
version: latest
arch: 'x86_64'
- base: windows
version: latest
arch: 'amd64'
- base: macos
version: 14
arch: 'arm64'
- base: macos
version: 13
arch: 'x86_64'

python: ['cp38', 'cp39', 'cp310', 'cp311', 'cp312']

steps:
- uses: actions/[email protected]

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_PROJECT_REQUIRES_PYTHON: "==${{ matrix.python_version }}.*"
CIBW_BUILD: "${{ matrix.python }}-*"

- uses: actions/[email protected]
with:
name: dist-python-${{ matrix.python_version }}-${{ matrix.os }}
name: dist-python-${{ matrix.python }}-${{ matrix.os.base }}-${{ matrix.os.arch }}
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected].4
- uses: actions/[email protected].6

- uses: actions/[email protected]
name: Install Python
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:
submodules: true
path: code

- name: Install tools
run: sudo apt install pcregrep pandoc

- name: Determine last tag via git describe
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }}
run: echo tag="$(git describe --abbrev=0)" >> "$GITHUB_ENV"
Expand Down
10 changes: 1 addition & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,13 @@ requires = ["setuptools>=64.0.0",
"oldest-supported-numpy"]

[tool.cibuildwheel]
# Build for cpython only
skip = "pp*"

# Test the wheels.
test-command = "pytest --pyargs gsd -v --log-level=DEBUG"
test-skip = "*-macosx_arm64"
test-requires = "pytest"

# Build only on 64-bit architectures.
# Build on 64-bit architectures.
archs = ["auto64"]

[tool.cibuildwheel.macos]
# Build for x86_64 and arm64
archs = ["x86_64", "arm64"]

[tool.cibuildwheel.linux]
# dependencies do not build for musl
skip = ["pp* *musllinux*"]

0 comments on commit 0f92e41

Please sign in to comment.