Skip to content

Commit

Permalink
[Done] OSX arm64 and universal2 wheels (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
caspervdw committed Nov 12, 2021
1 parent 327c919 commit c70ce4a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 35 deletions.
66 changes: 34 additions & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,32 +37,38 @@ jobs:
retention-days: 30

build_wheels:
name: Build ${{ matrix.archs }} wheels on ${{ matrix.os }}
name: Build ${{ matrix.arch }} wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
GEOS_VERSION: "3.10.1"
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-10.15]
archs: [auto32, auto64]
exclude:
# osx doesn't have 32-bit builds
- os: macos-10.15
archs: auto32
include:
# Only numpy >= 1.19 has aarch64 wheels
- os: ubuntu-20.04
archs: aarch64
# Numpy doesn't have ppc64le wheels:
# - os: ubuntu-20.04
# archs: ppc64le
# We know that tests don't pass on s390x:
# - os: ubuntu-20.04
# archs: s390x
# On ARM64, the GEOS libraries do not end up in the wheel:
# - os: macos-10.15
# archs: arm64
arch: x86_64
- os: ubuntu-20.04
arch: i686
- os: ubuntu-20.04
arch: aarch64
qemu_platform: arm64
# Note: Numpy doesn't have ppc64le & s390x wheels
# Also, some GEOS tests fail on s390x.
- os: windows-2019
arch: x86
msvc_arch: x86
- os: windows-2019
arch: AMD64
msvc_arch: x64
- os: macos-10.15
arch: x86_64
cmake_osx_architectures: x86_64
- os: macos-10.15
arch: arm64
cmake_osx_architectures: arm64
- os: macos-10.15
arch: universal2
cmake_osx_architectures: "x86_64;arm64"

steps:
- uses: actions/checkout@v2
Expand All @@ -71,7 +77,7 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ runner.temp }}/geos-${{ env.GEOS_VERSION }}
key: ${{ matrix.os }}-${{ matrix.archs }}-${{ env.GEOS_VERSION }}-${{ hashFiles('ci/*') }}
key: ${{ matrix.os }}-${{ matrix.arch }}-${{ env.GEOS_VERSION }}-${{ hashFiles('ci/*') }}

- name: Add GEOS LICENSE
run: |
Expand All @@ -87,26 +93,20 @@ jobs:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: arm64
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.archs == 'aarch64' }}

- name: Activate MSVC 32-bit
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86
if: ${{ matrix.os == 'windows-2019' && matrix.archs == 'auto32' }}
platforms: ${{ matrix.qemu_platform }}
if: ${{ matrix.qemu_platform }}

- name: Activate MSVC 64-bit
- name: Activate MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
if: ${{ matrix.os == 'windows-2019' && matrix.archs == 'auto64' }}
arch: ${{ matrix.msvc_arch }}
if: ${{ matrix.msvc_arch }}

- name: Build wheels
uses: pypa/cibuildwheel@v2.2.2
env:
CIBW_ARCHS: ${{ matrix.archs }}
CIBW_SKIP: pp* *musllinux*
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_SKIP: pp* *musllinux* cp310-win32 cp310-macosx_x86_64 cp310-manylinux_i686
CIBW_ENVIRONMENT_LINUX:
GEOS_VERSION=${{ env.GEOS_VERSION }}
GEOS_INSTALL=/host${{ runner.temp }}/geos-${{ env.GEOS_VERSION }}
Expand All @@ -116,6 +116,8 @@ jobs:
GEOS_INSTALL=${{ runner.temp }}/geos-${{ env.GEOS_VERSION }}
GEOS_CONFIG=${{ runner.temp }}/geos-${{ env.GEOS_VERSION }}/bin/geos-config
LDFLAGS=-Wl,-rpath,${{ runner.temp }}/geos-${{ env.GEOS_VERSION }}/lib
MACOSX_DEPLOYMENT_TARGET=10.9
CMAKE_OSX_ARCHITECTURES='${{ matrix.cmake_osx_architectures }}'
CIBW_ENVIRONMENT_WINDOWS:
GEOS_INSTALL='${{ runner.temp }}\geos-${{ env.GEOS_VERSION }}'
GEOS_LIBRARY_PATH='${{ runner.temp }}\geos-${{ env.GEOS_VERSION }}\lib'
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,21 @@ Changelog
Version 0.12 (unreleased)
-------------------------

**Distribution**

* Distribute binary wheels for Apple Silicon architecture
(arm64 and universal2) (#427).
* Removed 32-bit architecture wheels for
Python 3.10 (#427).
* All binary wheels now have GEOS 3.10.1. See https://github.com/libgeos/geos/blob/main/NEWS
for the changes (#422).


**Major enhancements**

* Added ``pygeos.dwithin`` for GEOS >= 3.10 (#417).
* Added GeoJSON input/output capabilities (``pygeos.from_geojson``,
``pygeos.to_geojson``) (#413).
``pygeos.to_geojson``) for GEOS >= 3.10 (#413).

**API Changes**

Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ requires = [
"numpy==1.19.3; python_version=='3.6' and platform_machine == 'aarch64'",
"numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64'",
"numpy==1.19.3; python_version=='3.7' and platform_machine == 'aarch64'",
"numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64'",
"numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'",
"numpy==1.19.3; python_version=='3.8' and platform_machine == 'aarch64'",
"numpy==1.19.3; python_version=='3.9'",
"numpy==1.21.3; python_version=='3.8' and platform_machine == 'arm64'",
"numpy==1.19.3; python_version=='3.9' and platform_machine != 'arm64'",
"numpy==1.21.3; python_version=='3.9' and platform_machine == 'arm64'",
"numpy==1.21.3; python_version=='3.10'",
# do not pin numpy on future versions of python to avoid incompatible numpy and python versions
"numpy; python_version>='3.11'",
Expand Down

0 comments on commit c70ce4a

Please sign in to comment.