14
0
forked from pool/python-pydub

Accepting request 1041290 from devel:languages:python

- Add skip_libopenh264-7.patch which skips failing tests when
  libopenh264 is not available (which is always, because the
  library is in Packman). gh#jiaaro/pydub#700

OBS-URL: https://build.opensuse.org/request/show/1041290
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pydub?expand=0&rev=8
This commit is contained in:
2022-12-08 15:51:57 +00:00
committed by Git OBS Bridge
3 changed files with 93 additions and 4 deletions

View File

@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Dec 7 23:23:13 UTC 2022 - Matej Cepl <mcepl@suse.com>
- Add skip_libopenh264-7.patch which skips failing tests when
libopenh264 is not available (which is always, because the
library is in Packman). gh#jiaaro/pydub#700
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Mar 10 20:05:05 UTC 2021 - Ben Greiner <code@bnavigator.de> Wed Mar 10 20:05:05 UTC 2021 - Ben Greiner <code@bnavigator.de>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-pydub # spec file for package python-pydub
# #
# Copyright (c) 2021 SUSE LLC # Copyright (c) 2022 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -16,7 +16,6 @@
# #
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pydub Name: python-pydub
Version: 0.25.1 Version: 0.25.1
Release: 0 Release: 0
@@ -25,6 +24,9 @@ License: MIT
Group: Development/Languages/Python Group: Development/Languages/Python
URL: https://github.com/jiaaro/pydub URL: https://github.com/jiaaro/pydub
Source: https://github.com/jiaaro/pydub/archive/v%{version}.tar.gz#/pydub-%{version}.tar.gz 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
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: ffmpeg BuildRequires: ffmpeg
@@ -41,7 +43,7 @@ BuildArch: noarch
A Python module to manipulate audio with a high level interface. A Python module to manipulate audio with a high level interface.
%prep %prep
%setup -q -n pydub-%{version} %autosetup -p1 -n pydub-%{version}
%build %build
%python_build %python_build
@@ -51,10 +53,12 @@ A Python module to manipulate audio with a high level interface.
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%check %check
export NO_OPENH264=1
%pyunittest -v test.test %pyunittest -v test.test
%files %{python_files} %files %{python_files}
%license LICENSE %license LICENSE
%{python_sitelib}/* %{python_sitelib}/pydub-%{version}*-info
%{python_sitelib}/pydub
%changelog %changelog

78
skip_libopenh264-7.patch Normal file
View File

@@ -0,0 +1,78 @@
---
test/test.py | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
--- a/test/test.py
+++ b/test/test.py
@@ -796,6 +796,8 @@ class AudioSegmentTests(unittest.TestCas
AudioSegment.from_file(self.mp3_file_path).export(tmp_webm_file,
format="webm")
+ @unittest.skipIf('NO_OPENH264' in os.environ,
+ "libopenh264 not available")
@unittest.skipUnless('aac' in get_supported_decoders(),
"Unsupported codecs")
def test_export_mp4_as_ogg(self):
@@ -803,6 +805,8 @@ class AudioSegmentTests(unittest.TestCas
AudioSegment.from_file(self.mp4_file_path).export(tmp_ogg_file,
format="ogg")
+ @unittest.skipIf('NO_OPENH264' in os.environ,
+ "libopenh264 not available")
@unittest.skipUnless('aac' in get_supported_decoders(),
"Unsupported codecs")
def test_export_mp4_as_mp3(self):
@@ -810,6 +814,8 @@ class AudioSegmentTests(unittest.TestCas
AudioSegment.from_file(self.mp4_file_path).export(tmp_mp3_file,
format="mp3")
+ @unittest.skipIf('NO_OPENH264' in os.environ,
+ "libopenh264 not available")
@unittest.skipUnless('aac' in get_supported_decoders(),
"Unsupported codecs")
def test_export_mp4_as_wav(self):
@@ -817,6 +823,8 @@ class AudioSegmentTests(unittest.TestCas
AudioSegment.from_file(self.mp4_file_path).export(tmp_wav_file,
format="mp3")
+ @unittest.skipIf('NO_OPENH264' in os.environ,
+ "libopenh264 not available")
@unittest.skipUnless('aac' in get_supported_decoders(),
"Unsupported codecs")
def test_export_mp4_as_mp3_with_tags(self):
@@ -830,6 +838,8 @@ class AudioSegmentTests(unittest.TestCas
format="mp3",
tags=tags_dict)
+ @unittest.skipIf('NO_OPENH264' in os.environ,
+ "libopenh264 not available")
@unittest.skipUnless('aac' in get_supported_decoders(),
"Unsupported codecs")
def test_export_mp4_as_mp3_with_tags_raises_exception_when_tags_are_not_a_dictionary(self):
@@ -840,6 +850,8 @@ class AudioSegmentTests(unittest.TestCas
format="mp3", tags=json)
self.assertRaises(InvalidTag, func)
+ @unittest.skipIf('NO_OPENH264' in os.environ,
+ "libopenh264 not available")
@unittest.skipUnless('aac' in get_supported_decoders(),
"Unsupported codecs")
def test_export_mp4_as_mp3_with_tags_raises_exception_when_id3version_is_wrong(self):
@@ -854,6 +866,8 @@ class AudioSegmentTests(unittest.TestCas
)
self.assertRaises(InvalidID3TagVersion, func)
+ @unittest.skipIf('NO_OPENH264' in os.environ,
+ "libopenh264 not available")
@unittest.skipUnless('aac' in get_supported_decoders(),
"Unsupported codecs")
def test_export_mp3_with_tags(self):
@@ -973,6 +987,8 @@ class AudioSegmentTests(unittest.TestCas
# average volume should be reduced
self.assertTrue(compressed.rms < self.seg1.rms)
+ @unittest.skipIf('NO_OPENH264' in os.environ,
+ "libopenh264 not available")
@unittest.skipUnless('aac' in get_supported_decoders(),
"Unsupported codecs")
def test_exporting_to_ogg_uses_default_codec_when_codec_param_is_none(self):