diff --git a/no-removed-formats.patch b/no-removed-formats.patch deleted file mode 100644 index f8b999f..0000000 --- a/no-removed-formats.patch +++ /dev/null @@ -1,27 +0,0 @@ -Index: audioread-3.0.1/audioread/__init__.py -=================================================================== ---- audioread-3.0.1.orig/audioread/__init__.py -+++ audioread-3.0.1/audioread/__init__.py -@@ -13,6 +13,7 @@ - # included in all copies or substantial portions of the Software. - - """Multi-library, cross-platform audio decoding.""" -+import sys - - from . import ffdec - from .exceptions import DecodeError, NoBackendError -@@ -76,9 +77,11 @@ def available_backends(flush_cache=False - if BACKENDS and not flush_cache: - return BACKENDS - -- # Standard-library WAV and AIFF readers. -- from . import rawread -- result = [rawread.RawAudioFile] -+ result = [] -+ if sys.version_info[:2] < (3, 13): -+ # Standard-library WAV and AIFF readers. -+ from . import rawread -+ result.append(rawread.RawAudioFile) - - # Core Audio. - if _ca_available(): diff --git a/python-audioread.changes b/python-audioread.changes index 23d10d4..a8b475e 100644 --- a/python-audioread.changes +++ b/python-audioread.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Dec 12 03:15:22 UTC 2024 - Steve Kowalik + +- Drop patch no-removed-formats.patch, it was a terrible idea. +- Add patch support-python-313.patch: + * Add two external module depends for Python 3.13+. + ------------------------------------------------------------------- Tue Nov 26 04:12:39 UTC 2024 - Steve Kowalik diff --git a/python-audioread.spec b/python-audioread.spec index 368714d..e6c9647 100644 --- a/python-audioread.spec +++ b/python-audioread.spec @@ -23,18 +23,24 @@ Summary: Wrapper for audio decoding via selectable backends License: MIT URL: https://github.com/beetbox/audioread Source0: https://github.com/beetbox/audioread/archive/v%{version}.tar.gz -# PATCH-FIX-OPENSUSE Do not use rawread backend on Python 3.13+ -Patch0: no-removed-formats.patch +# PATCH-FIX-UPSTREAM Based on gh#beetbox/audioread#145 +Patch0: support-python-313.patch BuildRequires: %{ffmpeg_pref} BuildRequires: %{python_module base} BuildRequires: %{python_module flit-core} BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} +BuildRequires: %{python_module standard-aifc if %python-base >= 3.13} +BuildRequires: %{python_module standard-sunau if %python-base >= 3.13} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildConflicts: %{ffmpeg_pref}-mini-libs BuildRequires: python-rpm-macros BuildArch: noarch +%if 0%{?python_version_nodots} >= 313 +Requires: python-standard-aifc +Requires: python-standard-sunau +%endif Recommends: /usr/bin/ffmpeg Recommends: python-gobject Recommends: python-pymad diff --git a/support-python-313.patch b/support-python-313.patch new file mode 100644 index 0000000..f27de21 --- /dev/null +++ b/support-python-313.patch @@ -0,0 +1,41 @@ +From c81adeb553f25f408a85803afcff7d3efd11f722 Mon Sep 17 00:00:00 2001 +From: Luke Blaney +Date: Wed, 30 Oct 2024 18:42:47 +0000 +Subject: [PATCH 1/2] Add standard-aifc and standard-sunau as dependencies for + python 3.13 and above. Python core removed these modules in 3.13 as part of + PEP-594 https://peps.python.org/pep-0594/ The standard-* modules are forks of + the modules that had previously been in the python core. Fixes + https://github.com/beetbox/audioread/issues/144 + +--- + pyproject.toml | 4 ++++ + 1 file changed, 4 insertions(+) + +Index: audioread-3.0.1/pyproject.toml +=================================================================== +--- audioread-3.0.1.orig/pyproject.toml ++++ audioread-3.0.1/pyproject.toml +@@ -11,6 +11,10 @@ readme = "README.rst" + requires-python = ">=3.6" + dynamic = ["version", "description"] + urls.Home = "https://github.com/beetbox/audioread" ++dependencies = [ ++ "standard-aifc; python_version >= '3.13'", ++ "standard-sunau; python_version >= '3.13'", ++] + classifiers = [ + 'Topic :: Multimedia :: Sound/Audio :: Conversion', + 'Intended Audience :: Developers', +Index: audioread-3.0.1/.github/workflows/main.yml +=================================================================== +--- audioread-3.0.1.orig/.github/workflows/main.yml ++++ audioread-3.0.1/.github/workflows/main.yml +@@ -8,7 +8,7 @@ jobs: + runs-on: ubuntu-latest + strategy: + matrix: +- python: ["3.8", "3.9", "3.10", "3.11"] ++ python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + + steps: + - uses: actions/checkout@v2