From c54d01ba41fb26882136bb5b5412a59fe9406bc823f9d4fcdbec47f94a074718 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Fri, 16 Feb 2024 03:32:20 +0000 Subject: [PATCH] - Add patch fix-assertions.patch: * Fix assetion methods. - Switch to pyproject macros. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pydub?expand=0&rev=19 --- fix-assertions.patch | 33 +++++++++++++++++++++++++++++++++ python-pydub.changes | 7 +++++++ python-pydub.spec | 13 ++++++++----- 3 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 fix-assertions.patch diff --git a/fix-assertions.patch b/fix-assertions.patch new file mode 100644 index 0000000..c7cd30d --- /dev/null +++ b/fix-assertions.patch @@ -0,0 +1,33 @@ +From 66c1bf7813ae8621a71484fdcdf609734c0d8efd Mon Sep 17 00:00:00 2001 +From: sirfredrick +Date: Thu, 28 Dec 2023 13:37:36 -0800 +Subject: [PATCH] Fix test assertions + +assertEquals() was a deprecated alias for assertEqual() and has been +removed in Python 3.12 See https://docs.python.org/3/whatsnew/3.12.html#id3 +--- + test/test.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/test/test.py b/test/test.py +index 1965761f..2da3d0fa 100644 +--- a/test/test.py ++++ b/test/test.py +@@ -1086,7 +1086,7 @@ def test_from_file_clean_fail(self): + tmp_wav_file.flush() + self.assertRaises(CouldntDecodeError, AudioSegment.from_file, tmp_wav_file.name) + files = os.listdir(tempfile.tempdir) +- self.assertEquals(files, [os.path.basename(tmp_wav_file.name)]) ++ self.assertEqual(files, [os.path.basename(tmp_wav_file.name)]) + + if sys.platform == 'win32': + os.remove(tmp_wav_file.name) +@@ -1109,7 +1109,7 @@ def setUp(self): + + def test_split_on_silence_complete_silence(self): + seg = AudioSegment.silent(5000) +- self.assertEquals( split_on_silence(seg), [] ) ++ self.assertEqual( split_on_silence(seg), [] ) + + def test_split_on_silence_test1(self): + self.assertEqual( diff --git a/python-pydub.changes b/python-pydub.changes index 458586a..c50c962 100644 --- a/python-pydub.changes +++ b/python-pydub.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Feb 16 03:31:40 UTC 2024 - Steve Kowalik + +- Add patch fix-assertions.patch: + * Fix assetion methods. +- Switch to pyproject macros. + ------------------------------------------------------------------- Wed Dec 7 23:23:13 UTC 2022 - Matej Cepl diff --git a/python-pydub.spec b/python-pydub.spec index b087788..38774c0 100644 --- a/python-pydub.spec +++ b/python-pydub.spec @@ -1,7 +1,7 @@ # # spec file for package python-pydub # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -21,13 +21,16 @@ Version: 0.25.1 Release: 0 Summary: Audio manipulation with Python License: MIT -Group: Development/Languages/Python URL: https://github.com/jiaaro/pydub Source: https://github.com/jiaaro/pydub/archive/v%{version}.tar.gz#/pydub-%{version}.tar.gz # PATCH-FIX-OPENSUSE skip_libopenh264-7.patch gh#jiaaro/pydub#700 mcepl@suse.com # We don't have libopenh264-7 on the plain openSUSE Patch0: skip_libopenh264-7.patch +# PATCH-FIX-UPSTREAM gh#jiaaro/pydub#769 +Patch1: fix-assertions.patch +BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: ffmpeg BuildRequires: python-rpm-macros @@ -46,10 +49,10 @@ A Python module to manipulate audio with a high level interface. %autosetup -p1 -n pydub-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -58,7 +61,7 @@ export NO_OPENH264=1 %files %{python_files} %license LICENSE -%{python_sitelib}/pydub-%{version}*-info +%{python_sitelib}/pydub-%{version}.dist-info %{python_sitelib}/pydub %changelog