-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy the approach from `asyncpg` to make the build matrix more granular
- Loading branch information
Showing
2 changed files
with
53 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,33 +59,48 @@ jobs: | |
python -m pip install -U setuptools wheel pip | ||
python setup.py sdist | ||
- uses: actions/upload-artifact@v2 | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist/*.tar.* | ||
|
||
build-wheels: | ||
build-wheels-matrix: | ||
needs: validate-release-request | ||
runs-on: ubuntu-latest | ||
outputs: | ||
include: ${{ steps.set-matrix.outputs.include }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
- run: pip install cibuildwheel==2.15.0 | ||
- id: set-matrix | ||
run: | | ||
MATRIX_INCLUDE=$( | ||
{ | ||
cibuildwheel --print-build-identifiers --platform linux --arch x86_64,aarch64 | grep cp | jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \ | ||
&& cibuildwheel --print-build-identifiers --platform macos --arch x86_64,arm64 | grep cp | jq -nRc '{"only": inputs, "os": "macos-latest"}' \ | ||
&& cibuildwheel --print-build-identifiers --platform windows --arch x86,AMD64 | grep cp | jq -nRc '{"only": inputs, "os": "windows-latest"}' | ||
} | jq -sc | ||
) | ||
echo "include=$MATRIX_INCLUDE" >> $GITHUB_OUTPUT | ||
build-wheels: | ||
needs: build-wheels-matrix | ||
runs-on: ${{ matrix.os }} | ||
name: Build ${{ matrix.only }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
cibw_arch: ["auto64", "aarch64", "universal2"] | ||
cibw_python: | ||
- "cp38-*" | ||
- "cp39-*" | ||
- "cp310-*" | ||
- "cp311-*" | ||
- "cp312-*" | ||
exclude: | ||
- os: ubuntu-latest | ||
cibw_arch: universal2 | ||
- os: macos-latest | ||
cibw_arch: aarch64 | ||
- os: windows-latest | ||
cibw_arch: universal2 | ||
- os: windows-latest | ||
cibw_arch: aarch64 | ||
include: ${{ fromJson(needs.build-wheels-matrix.outputs.include) }} | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
env: | ||
PIP_DISABLE_PIP_VERSION_CHECK: 1 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
@@ -94,23 +109,17 @@ jobs: | |
submodules: true | ||
|
||
- name: Set up QEMU | ||
if: matrix.os == 'ubuntu-latest' && matrix.cibw_arch == 'aarch64' | ||
if: runner.os == 'Linux' | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm64 | ||
|
||
- uses: pypa/[email protected] | ||
- uses: pypa/cibuildwheel@39a63b5912f086dd459cf6fcb13dcdd3fe3bc24d # v2.15.0 | ||
with: | ||
only: ${{ matrix.only }} | ||
env: | ||
CIBW_BUILD_VERBOSITY: 1 | ||
CIBW_BUILD: ${{ matrix.cibw_python }} | ||
CIBW_ARCHS: ${{ matrix.cibw_arch }} | ||
CIBW_TEST_EXTRAS: "test" | ||
CIBW_TEST_COMMAND: "cd .. && python {project}/tests/__init__.py" | ||
CIBW_TEST_COMMAND_WINDOWS: "cd .. && python {project}\\tests\\__init__.py" | ||
CIBW_TEST_SKIP: "*universal2:arm64" | ||
CIBW_ENVIRONMENT: "IMMU_SKIP_MYPY_TESTS=1" | ||
|
||
- uses: actions/upload-artifact@v2 | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: wheelhouse/*.whl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
name = "immutables" | ||
description = "Immutable Collections" | ||
authors = [{name = "MagicStack Inc", email = "[email protected]"}] | ||
requires-python = '>=3.8.0' | ||
readme = "README.rst" | ||
license = {text = "Apache License, Version 2.0"} | ||
dynamic = ["version"] | ||
|
@@ -78,3 +79,16 @@ ignore_errors = true | |
[[tool.mypy.overrides]] | ||
module = "immutables._testutils" | ||
ignore_errors = true | ||
|
||
[tool.cibuildwheel] | ||
build-frontend = "build" | ||
test-extras = "test" | ||
|
||
[tool.cibuildwheel.macos] | ||
test-command = "python {project}/tests/__init__.py" | ||
|
||
[tool.cibuildwheel.windows] | ||
test-command = "python {project}\\tests\\__init__.py" | ||
|
||
[tool.cibuildwheel.linux] | ||
test-command = "python {project}/tests/__init__.py" |