Skip to content

πŸŽ› πŸ”Š A Python library for audio.

Try building wheels for Python 3.10. (#36)

Peter Sobot35b4b04aee00
diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml
index 73a4863..3bcece6 100644
--- a/.github/workflows/all.yml
+++ b/.github/workflows/all.yml
@@ -14,7 +14,7 @@ jobs:
continue-on-error: true
strategy:
matrix:
- python-version: ['3.6', '3.7', '3.8', '3.9', '3.x']
+ python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
os: [ubuntu-latest]
name: Lint Python
steps:
@@ -26,6 +26,10 @@ jobs:
with:
submodules: recursive
- name: Install lint dependencies
+ env:
+ # on macOS and with Python 3.10: building NumPy from source fails without these options:
+ NPY_BLAS_ORDER: ""
+ NPY_LAPACK_ORDER: ""
run: |
python -m pip install --upgrade pip
pip install wheel
@@ -55,7 +59,7 @@ jobs:
MINIMUM_COVERAGE_PERCENTAGE: 90
strategy:
matrix:
- python-version: ['3.6', '3.7', '3.8', '3.9', '3.x']
+ python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
os: [ubuntu-18.04, ubuntu-latest, windows-latest, macos-10.15, macos-latest]
name: Test with Python ${{ matrix.python-version }} on ${{ matrix.os }}
steps:
@@ -75,6 +79,10 @@ jobs:
libxrender-dev libxcomposite-dev libxcb-xinerama0-dev \
libxcursor-dev libfreetype6 libfreetype6-dev
- name: Install test dependencies
+ env:
+ # on macOS and with Python 3.10: building NumPy from source fails without these options:
+ NPY_BLAS_ORDER: ""
+ NPY_LAPACK_ORDER: ""
run: |
python -m pip install --upgrade pip
pip install wheel
@@ -120,7 +128,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
- python-version: ['3.6', '3.7', '3.8', '3.9', '3.x']
+ python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
os: [ubuntu-latest]
name: Test with Python ${{ matrix.python-version }} + Address Sanitizer
steps:
@@ -187,7 +195,7 @@ jobs:
CIBW_TEST_REQUIRES: -r test-requirements.txt
CIBW_TEST_COMMAND: "pytest {project}/tests"
CIBW_ARCHS: auto64 # Only support building 64-bit wheels. It's 2021!
- CIBW_SKIP: '*27* *35* *310*' # Ignore Python 2.x, 3.5 (too old), and 3.10 (too new)
+ CIBW_SKIP: '*27* *35*' # Ignore Python 2.x, 3.5
CIBW_ARCHS_MACOS: x86_64 universal2 # Support Apple Silicon
CIBW_REPAIR_WHEEL_COMMAND_LINUX: pip install auditwheel-symbols && (auditwheel repair -w {dest_dir} {wheel} || auditwheel-symbols --manylinux 2010 {wheel})
CIBW_BEFORE_BUILD_LINUX: |
diff --git a/pedalboard/pedalboard.py b/pedalboard/pedalboard.py
index 21067dc..0e184cf 100644
--- a/pedalboard/pedalboard.py
+++ b/pedalboard/pedalboard.py
@@ -26,7 +26,7 @@ import numpy as np
from pedalboard_native import Plugin, process, _AudioProcessorParameter
-class Pedalboard(collections.MutableSequence):
+class Pedalboard(collections.abc.MutableSequence):
"""
A container for a chain of plugins, to use for processing audio.
"""
diff --git a/pedalboard/version.py b/pedalboard/version.py
index cb0d3d7..0a69706 100644
--- a/pedalboard/version.py
+++ b/pedalboard/version.py
@@ -17,6 +17,6 @@
MAJOR = 0
MINOR = 3
-PATCH = 7
+PATCH = 8
__version__ = "%d.%d.%d" % (MAJOR, MINOR, PATCH)
diff --git a/test-requirements.txt b/test-requirements.txt
index 52f2345..146ae0a 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -1,7 +1,7 @@
-coverage==5.0.2
-pytest==5.3.2
-pytest-cov==2.8.1
-pytest-mock==3.3.1
+coverage
+pytest>6.2
+pytest-cov
+pytest-mock
pybind11>=2.6.0
setuptools>=42
wheel
@@ -11,6 +11,6 @@ interrogate
numpy
sox
-tensorflow==2.5.0
+tensorflow==2.5.0; python_version < '3.10'
google-cloud-storage
-tqdm
\ No newline at end of file
+tqdm
diff --git a/tests/test_tensorflow.py b/tests/test_tensorflow.py
index 06271e8..9ad8bf5 100644
--- a/tests/test_tensorflow.py
+++ b/tests/test_tensorflow.py
@@ -14,11 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
+import sys
import numpy as np
-
-import tensorflow as tf
-
import pedalboard
@@ -27,6 +24,15 @@ def test_can_be_called_in_tensorflow_data_pipeline():
plugins = pedalboard.Pedalboard([pedalboard.Gain(), pedalboard.Reverb()], sample_rate=sr)
noise = np.random.rand(sr)
+
+ try:
+ import tensorflow as tf
+ except ModuleNotFoundError:
+ # TensorFlow is not yet supported on Python 3.10 - don't bother testing.
+ if sys.version_info.minor >= 10:
+ return
+ raise
+
ds = tf.data.Dataset.from_tensor_slices([noise]).map(
lambda audio: tf.numpy_function(plugins.process, [audio], tf.float32)
)