Skip to content

Commit

Permalink
Merge pull request #351 from JeppeKlitgaard/buildwheels-python311-sup…
Browse files Browse the repository at this point in the history
…port

Additional platform support and removal of support for old setups
  • Loading branch information
hgomersall committed Jan 6, 2023
2 parents 7b773ed + 6a41671 commit 965b82f
Show file tree
Hide file tree
Showing 5 changed files with 195 additions and 109 deletions.
124 changes: 88 additions & 36 deletions .github/workflows/wheel_tests_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- 'buildwheels*'

tags:
- 'v*'
Expand All @@ -18,9 +19,9 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
os: [ubuntu-22.04]

cibw_python: ["cp37", "cp38", "cp39", "cp310"]
cibw_python: ["cp38", "cp39", "cp310", "cp311", "pp38"]
# SciPy and NumPy don't support musllinux
cibw_libc: ["manylinux"]
cibw_arch: ["x86_64", "i686", "aarch64"]
Expand All @@ -29,19 +30,27 @@ jobs:
# SciPy and NumPy don't support 32-bit Linux from Python 3.10 and onwards
- cibw_python: "cp310"
cibw_arch: "i686"
- cibw_python: "cp311"
cibw_arch: "i686"

# Numpy only supports pypy38 x86_64 on Linux
- cibw_python: "pp38"
cibw_arch: "i686"
- cibw_python: "pp38"
cibw_arch: "aarch64"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.9'
python-version: '3.11'

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
with:
platforms: arm64

Expand All @@ -68,30 +77,37 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-11]
os: [macos-12]

cibw_python: ["cp37", "cp38", "cp39", "cp310"]
# Add arm64 when we support it
# TODO: Fix this
cibw_python: ["cp38", "cp39", "cp310", "cp311", "pp38"]
# See issue [#352](https://github.com/pyFFTW/pyFFTW/issues/352)
# TODO: Add arm64 when we support it
# Current problem seems to be that installed libfftw3 does not provide arm64
# symbols
cibw_arch: ["x86_64"]

exclude:
# cibuildwheel only supports pypy38 x86_64 on MacOS
- cibw_python: "pp38"
cibw_arch: "arm64"
- cibw_python: "pp38"
cibw_arch: "universal2"

env:
MACOSX_DEPLOYMENT_TARGET: "10.13"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install FFTW3 libraries
run: |
brew install fftw
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.9'
python-version: '3.11'

- name: Install cibuildwheel
run: |
Expand All @@ -114,56 +130,92 @@ jobs:
# Only works for 64-bit.
# 32-bit is likely possible, but probably not worth the time investment to get
# working given low usage
name: Build ${{ matrix.cibw_python }}-win_${{ matrix.cibw_arch }} wheel on ${{ matrix.os }}
name: Build ${{ matrix.cibw_python }}-win${{ matrix.cibw_arch }} wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2022]

cibw_python: ["cp37", "cp38", "cp39", "cp310"]
# Add arm64 when we support it
# We don't support Windows 32-bit
cibw_arch: ["amd64"]
cibw_python: ["cp38", "cp39", "cp310", "cp311", "pp38"]
# # Add arm64 when we support it
# # We don't support Windows 32-bit
cibw_arch: ["_amd64", "32", "_arm64"]

exclude:
# windows arm64 support is 3.9+
- cibw_python: "cp38"
cibw_arch: "_arm64"

# cibuildwheel only supports pypy38 AMD64 on Windows
- cibw_python: "pp38"
cibw_arch: "32"
- cibw_python: "pp38"
cibw_arch: "_arm64"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.9'
python-version: '3.11'

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel
- name: Download FFTW libraries
run: |
Write-Output "Downloading FFTW release (64 bit)"
Invoke-WebRequest -Uri "https://fftw.org/pub/fftw/fftw-3.3.5-dll64.zip" -OutFile "${{ github.workspace }}\fftw.zip"
Write-Output "Unzipping FFTW release"
Expand-Archive -Path "${{ github.workspace }}\fftw.zip" -DestinationPath "${{ github.workspace }}\pyfftw"
Write-Output "Downloading FFTW release (64-bit)"
Invoke-WebRequest -Uri "https://fftw.org/pub/fftw/fftw-3.3.5-dll64.zip" -OutFile "${{ github.workspace }}\fftw64.zip"
Write-Output "Unzipping 64-bit FFTW release"
Expand-Archive -Path "${{ github.workspace }}\fftw64.zip" -DestinationPath "${{ github.workspace }}\fftw64"
Write-Output "Downloading FFTW release (32-bit)"
Invoke-WebRequest -Uri "https://fftw.org/pub/fftw/fftw-3.3.5-dll32.zip" -OutFile "${{ github.workspace }}\fftw32.zip"
Write-Output "Unzipping 32-bit FFTW release"
Expand-Archive -Path "${{ github.workspace }}\fftw32.zip" -DestinationPath "${{ github.workspace }}\fftw32"
shell: powershell

# Annoyingly these two next steps are needed as FFTW does not ship with
# .lib files which msvc requires for linking
- uses: ilammy/msvc-dev-cmd@v1
name: Setup Visual Code build tools
- name: Setup Visual Code build tools (32-bit)
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86
if: ${{ matrix.cibw_arch == '32' }}

- name: Setup Visual Code build tools (64-bit)
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
if: ${{ matrix.cibw_arch != '32' }}

- name: Convert .def files to .lib
run: |
lib.exe /def:${{ github.workspace }}\pyfftw\libfftw3-3.def /out:${{ github.workspace }}\pyfftw\libfftw3-3.lib /machine:x64
lib.exe /def:${{ github.workspace }}\pyfftw\libfftw3f-3.def /out:${{ github.workspace }}\pyfftw\libfftw3f-3.lib /machine:x64
lib.exe /def:${{ github.workspace }}\pyfftw\libfftw3l-3.def /out:${{ github.workspace }}\pyfftw\libfftw3l-3.lib /machine:x64
lib.exe /def:${{ github.workspace }}\fftw64\libfftw3-3.def /out:${{ github.workspace }}\fftw64\libfftw3-3.lib /machine:x64
lib.exe /def:${{ github.workspace }}\fftw64\libfftw3f-3.def /out:${{ github.workspace }}\fftw64\libfftw3f-3.lib /machine:x64
lib.exe /def:${{ github.workspace }}\fftw64\libfftw3l-3.def /out:${{ github.workspace }}\fftw64\libfftw3l-3.lib /machine:x64
lib.exe /def:${{ github.workspace }}\fftw32\libfftw3-3.def /out:${{ github.workspace }}\fftw32\libfftw3-3.lib /machine:x86
lib.exe /def:${{ github.workspace }}\fftw32\libfftw3f-3.def /out:${{ github.workspace }}\fftw32\libfftw3f-3.lib /machine:x86
lib.exe /def:${{ github.workspace }}\fftw32\libfftw3l-3.def /out:${{ github.workspace }}\fftw32\libfftw3l-3.lib /machine:x86
- name: Build Windows wheels for CPython (Win64)
- name: Build Windows wheels
env:
ARCHITECTURE_BIT: ${{ matrix.cibw_arch == '32' && '32' || '64' }}
CIBW_BUILD: ${{ matrix.cibw_python }}-win${{ matrix.cibw_arch }}
CIBW_BEFORE_BUILD: >-
(robocopy
${{ github.workspace }}\fftw${{ matrix.cibw_arch == '32' && '32' || '64' }}
${{ github.workspace }}\pyfftw /V /S /E)
^& exit 0
run: |
python -m cibuildwheel --output-dir dist
env:
CIBW_BUILD: ${{ matrix.cibw_python }}-win_${{ matrix.cibw_arch }}
- uses: actions/upload-artifact@v2
name: Upload wheels as artifacts
Expand All @@ -178,13 +230,13 @@ jobs:
if: github.repository_owner == 'pyFFTW' && startsWith(github.ref, 'refs/tags/v') && always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.9'
python-version: '3.11'

- name: Install Twine
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.py[cod]
__pycache__
*.so
*.c
*.swp
Expand Down
32 changes: 18 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Current Build Status

| GitHub Actions | Read the Docs |
| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| GitHub Actions | Read the Docs |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| [![Build Wheels, Test and Release](https://github.com/pyFFTW/pyFFTW/actions/workflows/wheel_tests_and_release.yml/badge.svg)](https://github.com/pyFFTW/pyFFTW/actions/workflows/wheel_tests_and_release.yml) | [![read_the_docs](https://readthedocs.org/projects/pyfftw/badge/?version=latest)](http://pyfftw.readthedocs.io/en/latest/?badge=latest) |

### Conda-forge Status
Expand Down Expand Up @@ -45,8 +45,8 @@ The documentation can be found on

## Requirements (i.e. what it was designed for)

- [Python](https://python.org) >= 3.7 (lower versions *may* work)
- [Numpy](https://www.numpy.org) >= 1.16 (lower versions *may* work)
- [Python](https://python.org) >= 3.8 (lower versions *may* work)
- [Numpy](https://www.numpy.org) >= 1.20 (lower versions *may* work)
- [FFTW](https://www.fftw.org) >= 3.3 (lower versions *may* work) libraries for
single, double, and long double precision in serial and multithreading
(pthreads or openMP) versions.
Expand All @@ -57,14 +57,15 @@ The documentation can be found on
In practice, pyFFTW *may* work with older versions of these dependencies, but
it is not tested against them.

We build wheels for PyPy 3.8, but this platform has not been tested.

## Optional Dependencies

- [Scipy](https://www.scipy.org) >= 1.2 (>= 1.4 required for the scipy.fft interface)
- [Scipy](https://www.scipy.org) >= 1.8
- [Dask](https://dask.pydata.org) >= 1.0

Scipy and Dask are only required in order to use their respective interfaces.
In practice, older versions may work, but they are not tested against. On SciPy
versions prior to 1.4, only the `scipy.fftpack` interface will be available.
In practice, older versions may work, but they are not tested against.

## Installation

Expand Down Expand Up @@ -97,13 +98,16 @@ Read on if you do want to build from source...

Prebuilt wheels are available for the following configurations:

| Python version | Windows (32 bit) | Windows (64 bit) | Windows ARM (64 bit) | MacOS | MacOS ARM | Linux (32 bit) | Linux (64 bit) | Linux ARM (64 bit) |
| :-----------------: | :--------------: | :--------------: | :------------------: | :---: | :-------- | :------------: | :------------: | :----------------: |
| < 3.7 (unsupported) |||||||||
| 3.7 |||||||||
| 3.8 |||||||||
| 3.9 |||||||||
| 3.10 |||||||||
| Python version | Windows (32 bit) | Windows (64 bit) | Windows ARM (64 bit) | MacOS | MacOS ARM | Linux (32 bit) | Linux (64 bit) | Linux ARM (64 bit) |
| :------------------------------: | :--------------: | :--------------: | :------------------: | :---: | :-------- | :------------: | :------------: | :----------------: |
| CPython < 3.8 (unsupported) |||||||||
| CPython 3.8 |||||||||
| CPython 3.9 |||||||||
| CPython 3.10 |||||||||
| CPython 3.11 |||||||||
| PyPy < 3.8 (unsupported) |||||||||
| PyPy 3.8 |||||||||
| PyPy > 3.8 (unsupported for now) |||||||||

If your configuration does not match one of these you will have to build `pyfft` from source yourself.
See instructions below.
Expand Down

0 comments on commit 965b82f

Please sign in to comment.