Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,60 @@ jobs:
pytest --pyargs pywt
fi
popd

build_stable_abi_wheel:
name: build-abi3-${{ matrix.platform }}
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4.1.2
- uses: actions/setup-python@2e3e4b15a884dc73a63f962bff250a855150a234 # v5.5.0
with:
python-version: "3.12"

- name: Build package
run: |
pip install build
python -m build --wheel -Csetup-args="--vsenv" -Csetup-args="-Dpython.allow_limited_api=true"

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
path: ./dist/*.whl
name: ${{ matrix.platform }}-abi3-wheel

test_stable_abi_wheel:
needs: build_stable_abi_wheel
name: test-abi3-${{ matrix.platform }}
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/setup-python@2e3e4b15a884dc73a63f962bff250a855150a234 # v5.5.0
with:
python-version: "3.14"

- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: ${{ matrix.platform }}-abi3-wheel

- name: Check downloaded artifact
run: |
ls

- name: Install downloaded wheel
shell: bash
run: |
pip install pywavelets-*-abi3-*.whl

- name: Install test dependencies
run: |
pip install pytest numpy matplotlib

- name: Run tests
run: |
pytest --pyargs pywt
30 changes: 26 additions & 4 deletions .github/workflows/wheel_tests_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
cibw_python: ["cp312", "cp313", "cp313t", "cp314", "cp314t"]
cibw_python: ["cp312", "cp313t", "cp314t"]
cibw_arch: ["x86_64"]
steps:
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4.1.2
Expand All @@ -45,6 +45,11 @@ jobs:
with:
python-version: "3.12"

- name: Enable Stable ABI for with-GIL interpreters
if: ${{ !endsWith(matrix.cibw_python, 't') }}
run: |
echo CIBW_CONFIG_SETTINGS="setup-args=-Dpython.allow_limited_api=true" >> "$GITHUB_ENV"

- name: Build the wheel
uses: pypa/cibuildwheel@7c619efba910c04005a835b110b057fc28fd6e93 # v3.2.0
with:
Expand All @@ -53,6 +58,7 @@ jobs:
CIBW_BUILD: ${{ matrix.cibw_python }}-*
CIBW_ARCHS_LINUX: ${{ matrix.cibw_arch }}
CIBW_ENABLE: cpython-freethreading

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: wheels_linux_${{ matrix.cibw_arch }}_${{ matrix.cibw_python }}
Expand All @@ -66,7 +72,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-22.04-arm]
cibw_python: ["cp312", "cp313", "cp313t", "cp314", "cp314t"]
cibw_python: ["cp312", "cp313t", "cp314t"]
cibw_arch: ["aarch64"]
steps:
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4.1.2
Expand All @@ -77,6 +83,11 @@ jobs:
with:
python-version: "3.12"

- name: Enable Stable ABI for with-GIL interpreters
if: ${{ !endsWith(matrix.cibw_python, 't') }}
run: |
echo CIBW_CONFIG_SETTINGS="setup-args=-Dpython.allow_limited_api=true" >> "$GITHUB_ENV"

- name: Build the wheel
uses: pypa/cibuildwheel@7c619efba910c04005a835b110b057fc28fd6e93 # v3.2.0
with:
Expand All @@ -85,6 +96,7 @@ jobs:
CIBW_BUILD: ${{ matrix.cibw_python }}-*
CIBW_ARCHS_LINUX: ${{ matrix.cibw_arch }}
CIBW_ENABLE: cpython-freethreading

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: wheels_linux_${{ matrix.cibw_arch }}_${{ matrix.cibw_python }}
Expand All @@ -97,7 +109,7 @@ jobs:
fail-fast: false
matrix:
os: [macos-15-intel, macos-14]
cibw_python: ["cp312", "cp313", "cp313t", "cp314", "cp314t"]
cibw_python: ["cp312", "cp313t", "cp314t"]
cibw_arch: ["x86_64", "arm64"]
exclude:
- os: macos-14
Expand All @@ -114,6 +126,11 @@ jobs:
with:
python-version: "3.12"

- name: Enable Stable ABI for with-GIL interpreters
if: ${{ !endsWith(matrix.cibw_python, 't') }}
run: |
echo CIBW_CONFIG_SETTINGS="setup-args=-Dpython.allow_limited_api=true" >> "$GITHUB_ENV"

- name: Build wheels for CPython (macOS) (x86_64)
if: matrix.cibw_arch == 'x86_64'
uses: pypa/cibuildwheel@7c619efba910c04005a835b110b057fc28fd6e93 # v3.2.0
Expand Down Expand Up @@ -148,7 +165,7 @@ jobs:
matrix:
os: [windows-latest, windows-11-arm]
cibw_arch: ["AMD64", "x86", "ARM64"]
cibw_python: ["cp312", "cp313", "cp313t", "cp314", "cp314t"]
cibw_python: ["cp312", "cp313t", "cp314t"]
exclude:
- os: windows-latest
cibw_arch: ARM64
Expand Down Expand Up @@ -184,6 +201,11 @@ jobs:
with:
architecture: arm64

- name: Enable Stable ABI for with-GIL interpreters
if: ${{ !endsWith(matrix.cibw_python, 't') }}
run: |
echo CIBW_CONFIG_SETTINGS="setup-args=-Dpython.allow_limited_api=true" >> $env:GITHUB_ENV

- name: Build Windows wheels for CPython
uses: pypa/cibuildwheel@7c619efba910c04005a835b110b057fc28fd6e93 # v3.2.0
with:
Expand Down
6 changes: 5 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ project(
'c', 'cython',
version: '1.10.0.dev0',
license: 'MIT',
meson_version: '>= 1.1.0',
meson_version: '>= 1.5.0',
default_options: [
'buildtype=debugoptimized',
'b_ndebug=if-release',
'c_std=c17',
# We default to false here (so produce wheels like cp314), and can opt into
# producing abi3 wheels. The setting in pyproject.toml is
# `limited-api=true`, but this default will ensure it is opt-in:
'python.allow_limited_api=false',
],
)

Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ homepage = "https://github.com/PyWavelets/pywt"
source = "https://github.com/PyWavelets/pywt"
documentation = "https://pywavelets.readthedocs.io/"

[tool.meson-python]
limited-api = true

[tool.ruff]
line-length = 88
target-version = 'py310'
Expand Down
1 change: 1 addition & 0 deletions pywt/_extensions/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ foreach pyx_file: pyx_files
py.extension_module(pyx_file[0],
[cython_gen.process(pyx_file[1])],
c_args : c_args,
limited_api: '3.12',
include_directories : 'c',
dependencies : [np_dep, cy_deps],
link_with : libc_wt,
Expand Down
Loading