Skip to content

Commit

Permalink
Add support for Python 3.13rc1 and drop support for Python 3.7. (#348)
Browse files Browse the repository at this point in the history
* Try building on Python 3.13b1.

* Use 3.13.0-beta.1.

* Update all.yml

* Update all.yml

* Enable building wheels for pre-release Pythons for now.

* Remove libexecinfo.

* Vendor execinfo.h (as the code is not used but required by JUCE).

* Add empty function bodies for execinfo.

* Add empty function bodies for execinfo.

* Try nogil builds.

* Upgrade PyBind11 to 2.13.0.

* Update all.yml

* Enable CIBW_FREE_THREADED_SUPPORT.

* Disable MUSL builds for free-threaded Python.

* Disable MUSL builds for 3.13 beta.

* Try only 3.13 on Linux for now.

* Update to 3.13.0-rc.1.

* Update all.yml

* Update pyproject.toml

* Update pyproject.toml

* Update list of supported Python versions.

* Stop building for Python 3.6.

* Use NumPy 2.10 for Python 3.13.

* Fix numpy dependencies in test-requirements.
  • Loading branch information
psobot authored Aug 13, 2024
1 parent 2adfc12 commit 15ed605
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 40 deletions.
66 changes: 37 additions & 29 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ jobs:
ccache --show-stats --verbose
ccache --zero-stats
# cat ${{ runner.workspace }}/.ccache_log || true
- name: Delete Existing Cache for ${{ runner.os }} Objects
run: gh cache delete --repo ${{ github.repository }} ${{ steps.cache-objects-restore.outputs.cache-primary-key }}
env:
# This token requires the "repo" scope.
GITHUB_TOKEN: ${{ secrets.ACTION_CLEAR_CACHES_TOKEN }}
# - name: Delete Existing Cache for ${{ runner.os }} Objects
# run: gh cache delete --repo ${{ github.repository }} ${{ steps.cache-objects-restore.outputs.cache-primary-key }}
# env:
# # This token requires the "repo" scope.
# GITHUB_TOKEN: ${{ secrets.ACTION_CLEAR_CACHES_TOKEN }}
- name: Save Cached ${{ runner.os }} Objects
id: cache-objects-save
uses: actions/cache/save@v4
Expand Down Expand Up @@ -215,11 +215,11 @@ jobs:
ccache --zero-stats
# cat ${{ runner.workspace }}/.ccache_log || true
# ls -lashR ${{ runner.workspace }}/pedalboard
- name: Delete Existing Cache for ${{ runner.os }} Objects
run: gh cache delete --repo ${{ github.repository }} ${{ steps.cache-objects-restore.outputs.cache-primary-key }}
env:
# This token requires the "repo" scope.
GITHUB_TOKEN: ${{ secrets.ACTION_CLEAR_CACHES_TOKEN }}
# - name: Delete Existing Cache for ${{ runner.os }} Objects
# run: gh cache delete --repo ${{ github.repository }} ${{ steps.cache-objects-restore.outputs.cache-primary-key }}
# env:
# # This token requires the "repo" scope.
# GITHUB_TOKEN: ${{ secrets.ACTION_CLEAR_CACHES_TOKEN }}
- name: Save Cached ${{ runner.os }} Objects
id: cache-objects-save
uses: actions/cache/save@v4
Expand Down Expand Up @@ -314,11 +314,11 @@ jobs:
ccache --zero-stats
# cat ${{ runner.workspace }}/.ccache_log || true
# ls -lashR ${{ runner.workspace }}
- name: Delete Existing Cache for ${{ runner.os }} Objects
run: gh cache delete --repo ${{ github.repository }} ${{ steps.cache-objects-restore.outputs.cache-primary-key }}
env:
# This token requires the "repo" scope.
GITHUB_TOKEN: ${{ secrets.ACTION_CLEAR_CACHES_TOKEN }}
# - name: Delete Existing Cache for ${{ runner.os }} Objects
# run: gh cache delete --repo ${{ github.repository }} ${{ steps.cache-objects-restore.outputs.cache-primary-key }}
# env:
# # This token requires the "repo" scope.
# GITHUB_TOKEN: ${{ secrets.ACTION_CLEAR_CACHES_TOKEN }}
- name: Save Cached ${{ runner.os }} Objects
id: cache-objects-save
uses: actions/cache/save@v4
Expand Down Expand Up @@ -447,24 +447,24 @@ jobs:
strategy:
matrix:
include:
- { os: macos-13, python-version: "3.7", compiler: "clang", cc: "ccache clang", cxx: "ccache clang++" }
- { os: macos-13, python-version: "3.8", compiler: "clang", cc: "ccache clang", cxx: "ccache clang++" }
- { os: macos-13, python-version: "3.9", compiler: "clang", cc: "ccache clang", cxx: "ccache clang++" }
- { os: macos-13, python-version: "3.10", compiler: "clang", cc: "ccache clang", cxx: "ccache clang++" }
- { os: macos-13, python-version: "3.11", compiler: "clang", cc: "ccache clang", cxx: "ccache clang++" }
- { os: macos-13, python-version: "3.12", compiler: "clang", cc: "ccache clang", cxx: "ccache clang++" }
- { os: ubuntu-20.04, python-version: "3.7", compiler: "gcc", cc: "ccache gcc", cxx: "ccache g++" }
- { os: macos-13, python-version: "3.13.0-rc.1", compiler: "clang", cc: "ccache clang", cxx: "ccache clang++" }
- { os: ubuntu-20.04, python-version: "3.8", compiler: "gcc", cc: "ccache gcc", cxx: "ccache g++" }
- { os: ubuntu-20.04, python-version: "3.9", compiler: "gcc", cc: "ccache gcc", cxx: "ccache g++" }
- { os: ubuntu-20.04, python-version: "3.10", compiler: "gcc", cc: "ccache gcc", cxx: "ccache g++" }
- { os: ubuntu-20.04, python-version: "3.11", compiler: "gcc", cc: "ccache gcc", cxx: "ccache g++" }
- { os: ubuntu-20.04, python-version: "3.12", compiler: "gcc", cc: "ccache gcc", cxx: "ccache g++" }
# - { os: windows-latest, python-version: "3.7", compiler: "msvc", cc: "msvc", cxx: "msvc" }
- { os: ubuntu-20.04, python-version: "3.13.0-rc.1", compiler: "gcc", cc: "ccache gcc", cxx: "ccache g++" }
# - { os: windows-latest, python-version: "3.8", compiler: "msvc", cc: "msvc", cxx: "msvc" }
# - { os: windows-latest, python-version: "3.9", compiler: "msvc", cc: "msvc", cxx: "msvc" }
# - { os: windows-latest, python-version: "3.10", compiler: "msvc", cc: "msvc", cxx: "msvc" }
# - { os: windows-latest, python-version: "3.11", compiler: "msvc", cc: "msvc", cxx: "msvc" }
- { os: windows-latest, python-version: "3.12", compiler: "msvc", cc: "msvc", cxx: "msvc" }
- { os: windows-latest, python-version: "3.13.0-rc.1", compiler: "msvc", cc: "msvc", cxx: "msvc" }
name: Test with Python ${{ matrix.python-version }} on ${{ matrix.os }}
steps:
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -593,7 +593,7 @@ jobs:
needs: [prime-asan-build-caches]
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: ['ubuntu-20.04']
name: Test with Python ${{ matrix.python-version }} + Address Sanitizer
steps:
Expand Down Expand Up @@ -679,47 +679,45 @@ jobs:
strategy:
matrix:
include:
- { os: macos-12, build: cp36-macosx_x86_64 }
- { os: macos-12, build: cp37-macosx_x86_64 }
- { os: macos-12, build: cp38-macosx_x86_64 }
- { os: macos-12, build: cp39-macosx_x86_64 }
- { os: macos-12, build: cp310-macosx_x86_64 }
- { os: macos-12, build: cp311-macosx_x86_64 }
- { os: macos-12, build: cp312-macosx_x86_64 }
# - { os: macos-12, build: cp313-macosx_x86_64 }
# - { os: macos-12, build: cp313t-macosx_x86_64 }
- { os: macos-12, build: cp38-macosx_universal2 }
- { os: macos-12, build: cp39-macosx_universal2 }
- { os: macos-12, build: cp310-macosx_universal2 }
- { os: macos-12, build: cp311-macosx_universal2 }
- { os: macos-12, build: cp312-macosx_universal2 }
# - { os: macos-12, build: cp313-macosx_universal2 }
# - { os: macos-12, build: cp313t-macosx_universal2 }
- { os: macos-12, build: cp38-macosx_arm64 }
- { os: macos-12, build: cp39-macosx_arm64 }
- { os: macos-12, build: cp310-macosx_arm64 }
- { os: macos-12, build: cp311-macosx_arm64 }
- { os: macos-12, build: cp312-macosx_arm64 }
# - { os: macos-12, build: cp313-macosx_arm64 }
# - { os: macos-12, build: cp313t-macosx_arm64 }
- { os: macos-12, build: pp37-macosx_x86_64 }
- { os: macos-12, build: pp38-macosx_x86_64 }
- { os: macos-12, build: pp39-macosx_x86_64 }
- { os: windows-latest, build: cp36-win_amd64 }
- { os: windows-latest, build: cp37-win_amd64 }
- { os: windows-latest, build: cp38-win_amd64 }
- { os: windows-latest, build: cp39-win_amd64 }
- { os: windows-latest, build: cp310-win_amd64 }
- { os: windows-latest, build: cp311-win_amd64 }
- { os: windows-latest, build: cp312-win_amd64 }
# - { os: windows-latest, build: cp313-win_amd64 }
# - { os: windows-latest, build: cp313t-win_amd64 }
- { os: windows-latest, build: pp37-win_amd64 }
- { os: windows-latest, build: pp38-win_amd64 }
- { os: windows-latest, build: pp39-win_amd64 }
- { os: windows-latest, build: cp36-win32 }
- { os: windows-latest, build: cp37-win32 }
- { os: windows-latest, build: cp38-win32 }
- { os: windows-latest, build: cp39-win32 }
- { os: windows-latest, build: cp310-win32 }
- { os: windows-latest, build: cp311-win32 }
- { os: windows-latest, build: cp312-win32 }
- { os: 'ubuntu-20.04', build: cp36-manylinux_x86_64 }
- { os: 'ubuntu-20.04', build: cp36-manylinux_aarch64 }
- { os: 'ubuntu-20.04', build: cp37-manylinux_x86_64 }
- { os: 'ubuntu-20.04', build: cp37-manylinux_aarch64 }
- { os: 'ubuntu-20.04', build: cp38-manylinux_x86_64 }
- { os: 'ubuntu-20.04', build: cp38-manylinux_aarch64 }
- { os: 'ubuntu-20.04', build: cp38-musllinux_x86_64 }
Expand All @@ -740,6 +738,14 @@ jobs:
- { os: 'ubuntu-20.04', build: cp312-manylinux_aarch64 }
- { os: 'ubuntu-20.04', build: cp312-musllinux_x86_64 }
- { os: 'ubuntu-20.04', build: cp312-musllinux_aarch64 }
- { os: 'ubuntu-20.04', build: cp313-manylinux_x86_64 }
- { os: 'ubuntu-20.04', build: cp313-manylinux_aarch64 }
# - { os: 'ubuntu-20.04', build: cp313-musllinux_x86_64 }
# - { os: 'ubuntu-20.04', build: cp313-musllinux_aarch64 }
- { os: 'ubuntu-20.04', build: cp313t-manylinux_x86_64 }
- { os: 'ubuntu-20.04', build: cp313t-manylinux_aarch64 }
# - { os: 'ubuntu-20.04', build: cp313t-musllinux_x86_64 }
# - { os: 'ubuntu-20.04', build: cp313t-musllinux_aarch64 }
- { os: 'ubuntu-20.04', build: pp37-manylinux_x86_64 }
- { os: 'ubuntu-20.04', build: pp37-manylinux_aarch64 }
- { os: 'ubuntu-20.04', build: pp38-manylinux_x86_64 }
Expand Down Expand Up @@ -779,10 +785,12 @@ jobs:
# The musllinux containers on aarch64 take 6+ hours to test.
# Also testing any pypy versions fails, as TensorFlow isn't pypy compatible.
CIBW_TEST_SKIP: "*manylinux* *musllinux_aarch* *pp* *-macosx_universal2:arm64"
CIBW_PRERELEASE_PYTHONS: "1"
# Use the minimum macOS deployment target that has C++17 support:
MACOSX_DEPLOYMENT_TARGET: "10.13"
CIBW_MUSLLINUX_X86_64_IMAGE: quay.io/pypa/musllinux_1_1_x86_64:2024-04-29-07d05a0
CIBW_MUSLLINUX_AARCH64_IMAGE: quay.io/pypa/musllinux_1_1_aarch64:2024-04-29-07d05a0
CIBW_FREE_THREADED_SUPPORT: "1"
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ We'd love to get patches from you!

To compile Pedalboard from scratch, the following packages will need to be installed:

- [Python 3.7](https://www.python.org/downloads/) or higher.
- [Python 3.8](https://www.python.org/downloads/) or higher.
- A C++ compiler, e.g. `gcc`, `clang`, etc.
- On macOS, a working Xcode installation should provide this.
- On Linux:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ If you are new to Python, follow [INSTALLATION.md](https://github.com/spotify/pe

### Compatibility

`pedalboard` is thoroughly tested with Python 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, and 3.12 as well as experimental support for PyPy 3.7, 3.8, and 3.9.
`pedalboard` is thoroughly tested with Python 3.8, 3.9, 3.10, 3.11, 3.12, and 3.13.

- Linux
- Tested heavily in production use cases at Spotify
Expand Down
2 changes: 1 addition & 1 deletion pedalboard/python_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ namespace py = pybind11;

using namespace Pedalboard;

PYBIND11_MODULE(pedalboard_native, m) {
PYBIND11_MODULE(pedalboard_native, m, py::mod_gil_not_used()) {
m.doc() =
("This module provides classes and functions for generating and adding "
"effects to audio. Most classes in this module are subclasses of "
Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
requires = [
"setuptools>=59.6.0",
"wheel>=0.36.2",
"pybind11>=2.12",
'pybind11>=2.13; python_version>="3.9"',
'pybind11<=2.12; python_version<="3.8"',
# Building with NumPy 2 allows backwards compatibility with NumPy 1:
'numpy>=2; python_version>="3.9"',
'numpy>=2.1.0rc1; python_version>="3.13"',
'numpy>=2; python_version>="3.9" and python_version<"3.13"',
'numpy<2; python_version<="3.8"',
]

Expand All @@ -18,4 +20,4 @@ before-all = "yum install -y libsndfile libX11-devel libXrandr-devel libXinerama
# Use apk instead of yum when building on Alpine Linux
# (Note: this is experimental, as most VSTs require glibc and thus Alpine Linux isn't that useful)
select = "*-musllinux*"
before-all = "apk add libsndfile libx11-dev libxrandr-dev libxinerama-dev libxrender-dev libxcomposite-dev libxinerama-dev libxcursor-dev freetype-dev libexecinfo-dev"
before-all = "apk add libsndfile libx11-dev libxrandr-dev libxinerama-dev libxrender-dev libxcomposite-dev libxinerama-dev libxcursor-dev freetype-dev"
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,13 +483,12 @@ def build_extensions(self, *args, **kwargs):
"Programming Language :: C++",
"Programming Language :: Python",
"Topic :: Multimedia :: Sound/Audio",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
],
ext_modules=[pedalboard_cpp],
install_requires=["numpy"],
Expand Down
7 changes: 5 additions & 2 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ coverage
pytest>6.2
pytest-cov
pytest-mock
pybind11>=2.10.4
pybind11<2.13; python_version < '3.7'
pybind11>=2.13; python_version >= '3.7'
setuptools>=59
pip>22; python_version > '3.6'
pip>21; python_version < '3.7'
wheel

numpy
numpy>=2.1.0rc1; python_version>="3.13"
numpy>=2; python_version>="3.9" and python_version<"3.13"
numpy<2; python_version<="3.8"
google-cloud-storage
tqdm
psutil
Expand Down
35 changes: 35 additions & 0 deletions vendors/execinfo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */

#ifndef _EXECINFO_H
#define _EXECINFO_H 1

/* Store up to SIZE return address of the current program state in
ARRAY and return the exact number of values stored. */
int backtrace(void **__array, int __size) { return 0; }

/* Return names of functions from the backtrace list in ARRAY in a newly
malloc()ed memory block. */
char **backtrace_symbols(void *const *__array, int __size) {
return (char **)0;
}

/* This function is similar to backtrace_symbols() but it writes the result
immediately to a file. */
void backtrace_symbols_fd(void *const *__array, int __size, int __fd) {}

#endif /* execinfo.h */
2 changes: 1 addition & 1 deletion vendors/pybind11
Submodule pybind11 updated 122 files

0 comments on commit 15ed605

Please sign in to comment.