14
0
forked from pool/python-pydub

- Enable sle15_python_module_pythons.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pydub?expand=0&rev=26
This commit is contained in:
2024-09-25 07:58:20 +00:00
committed by Git OBS Bridge
commit 4621840aff
7 changed files with 396 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

33
fix-assertions.patch Normal file
View File

@@ -0,0 +1,33 @@
From 66c1bf7813ae8621a71484fdcdf609734c0d8efd Mon Sep 17 00:00:00 2001
From: sirfredrick <sirfredrick@mathbf.com>
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(

3
pydub-0.25.1.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:94f423c9acc9f361203e82a204420bb8fb85731d0586ebd2c1509fbeadeabad6
size 27555582

181
python-pydub.changes Normal file
View File

@@ -0,0 +1,181 @@
-------------------------------------------------------------------
Tue Sep 24 23:02:36 UTC 2024 - Guang Yee <gyee@suse.com>
- Enable sle15_python_module_pythons.
-------------------------------------------------------------------
Mon May 20 11:49:43 UTC 2024 - Antonio Larrosa <alarrosa@suse.com>
- If ffmpeg_pref is defined, use it, otherwise use ffmpeg-6 or
ffmpeg-4 depening on suse_version.
-------------------------------------------------------------------
Fri May 17 11:30:40 UTC 2024 - Antonio Larrosa <alarrosa@suse.com>
- Build with ffmpeg-6 in TW and ffmpeg-4 in Leap
-------------------------------------------------------------------
Mon Mar 25 04:56:28 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- Switch to pytest macro.
- Limit to ffmpeg 5.
-------------------------------------------------------------------
Fri Feb 16 03:31:40 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch fix-assertions.patch:
* Fix assetion methods.
- Switch to pyproject macros.
-------------------------------------------------------------------
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>
- Update to 0.25.1
* Fix crashing bug in new scipy-powered EQ effects
- Release 0.25.0
* Don't show a runtime warning about the optional ffplay
dependency being missing until someone trys to use it
* Documentation improvements
* Python 3.9 support
* Improved efficiency of loading wave files with pydub.
AudioSegment.from_file()
* Ensure pydub.AudioSegment().export() always retuns files with
a seek position at the beginning of the file
* Added more EQ effects to pydub.scipy_effects (requires scipy
to be installed)
* Fix a packaging bug where the LICENSE file was not included in
the source distribution
* Add a way to instantiate a pydub.AudioSegment() with a portion
of an audio file via pydub.AudioSegment().from_file()
- Release 0.24.1
* Fix bug where ffmpeg errors in Python 3 are illegible
* Fix bug where split_on_silence fails when there are one or
fewer nonsilent segments
* Fix bug in fallback audioop implementation
- Release 0.24.0
* Fix inconsistent handling of 8-bit audio
* Fix bug where certain files will fail to parse
* Fix bug where pyaudio stream is not closed on error
* Allow codecs and parameters in wav and raw export
* Fix bug in pydub.AudioSegment.from_file where supplied codec
is ignored
* Allow pydub.silence.split_on_silence to take a boolean for
keep_silence
* Fix bug where pydub.silence.split_on_silence sometimes adds
non-silence from adjacent segments
* Fix bug where pydub.AudioSegment.extract_wav_headers fails on
empty wav files
* Add new function pydub.silence.detect_leading_silence
* Support conversion between an arbitrary number of channels and
mono in pydub.AudioSegment.set_channels
* Fix several issues related to reading from filelike objects
- Drop 0001-Skip-tests-that-use-unavailable-codecs.patch merged
upstream
- Reinstate python36 build. SciPy is optional
-------------------------------------------------------------------
Sat Feb 13 10:14:16 UTC 2021 - Dirk Müller <dmueller@suse.com>
- skip python 3.6 build (no scipy)
-------------------------------------------------------------------
Tue Feb 19 19:14:45 UTC 2019 - Antonio Larrosa <alarrosa@suse.com>
- Enable tests. Changed source to the github release, which also
removes the need to provide a copy of the LICENSE file.
- Add 0001-Skip-tests-that-use-unavailable-codecs.patch to skip
tests that use codecs not supported by the official ffmpeg package
-------------------------------------------------------------------
Mon Feb 18 10:12:59 UTC 2019 - Antonio Larrosa <alarrosa@suse.com>
- Update to 0.23.1
* Fix bug in passing ffmpeg/avconv parameters for
pydub.AudioSegment.from_mp3(), pydub.AudioSegment.from_flv(),
pydub.AudioSegment.from_ogg() and pydub.AudioSegment.from_wav()
* Fix logic bug in pydub.effects.strip_silence()
-------------------------------------------------------------------
Tue Dec 4 12:52:09 UTC 2018 - Matej Cepl <mcepl@suse.com>
- Remove superfluous devel dependency for noarch package
-------------------------------------------------------------------
Wed Oct 31 11:26:43 UTC 2018 - Jan Engelhardt <jengelh@inai.de>
- Use noun phrase.
-------------------------------------------------------------------
Wed Oct 31 04:48:36 UTC 2018 - Todd R <toddrme2178@gmail.com>
- Update to 0.23.0
* Add support for playback via simpleaudio
* Allow users to override the type in pydub.AudioSegment().get_array_of_samples() (PR #313)
* Fix a bug where the wrong codec was used for 8-bit audio (PR #309 - issue #308)
-------------------------------------------------------------------
Wed Jul 11 17:18:18 UTC 2018 - alarrosa@suse.com
- Update to 0.22.1
* Fix pydub.utils.mediainfo_json() to work with newer,
backwards-incompatible versions of ffprobe/avprobe
- Update to 0.22.0
* Adds support for audio with frame rates (sample rates) of 48k and higher
(requires scipy) (PR #262, fixes #134, #237, #209)
* Adds support for PEP 519 File Path protocol (PR #252)
* Fixes a few places where handles to temporary files are kept open (PR #280)
* Add the license file to the python package to aid other packaging projects
(PR #279, fixes #274)
* Big fix for pydub.silence.detect_silence() (PR #263)
-------------------------------------------------------------------
Thu May 10 00:03:10 UTC 2018 - toddrme2178@gmail.com
- Update to 0.21.0
* NOTE: Semi-counterintuitive change: using the a stride when
slicing AudioSegment instances (for example, `sound[::5000]`)
will return chunks of 5000ms (not 1ms chunks every 5000ms)
(#222)
* Debug output from ffmpeg/avlib is no longer printed to the
console unless you set up logging (see README for how to set
up logging for your converter) (#223)
* All pydub exceptions are now subclasses of
`pydub.exceptions.PydubException`
* The utilities in `pydub.silence` now accept a
`seek_step` argument which can optionally be passed to
improve the performance of silence detection (#211)
* Fix to `pydub.silence` utilities which allow you to detect
perfect silence (#233)
* Fix a bug where threaded code screws up your terminal session
due to ffmpeg inheriting the stdin from the parent process.
(#231)
* Fix a bug where a crashing programs using pydub would leave
behind their temporary files (#206)
- Use license tag
-------------------------------------------------------------------
Wed Oct 18 16:45:45 UTC 2017 - toddrme2178@gmail.com
- Implement single-spec version
- Update to version 0.20.0
* See changelog at https://github.com/jiaaro/pydub/blob/v0.20.0/CHANGELOG.md
-------------------------------------------------------------------
Sat Oct 1 18:05:47 UTC 2016 - mardnh@gmx.de
- Update to version 0.16.5
- upstream does not provide a changelog
-------------------------------------------------------------------
Mon Jul 14 11:35:14 UTC 2014 - toddrme2178@gmail.com
- - Initial version

77
python-pydub.spec Normal file
View File

@@ -0,0 +1,77 @@
#
# spec file for package python-pydub
#
# 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
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%if 0%{?!ffmpeg_pref:1}
%if 0%{?suse_version} >= 1550
%define ffmpeg_pref ffmpeg-6
%else
%define ffmpeg_pref ffmpeg-4
%endif
%endif
%{?sle15_python_module_pythons}
Name: python-pydub
Version: 0.25.1
Release: 0
Summary: Audio manipulation with Python
License: MIT
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: %{ffmpeg_pref}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module scipy}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildConflicts: %{ffmpeg_pref}-mini-libs
BuildRequires: python-rpm-macros
Requires: %{ffmpeg_pref}
Recommends: python-scipy
Recommends: python-simpleaudio
BuildArch: noarch
%python_subpackages
%description
A Python module to manipulate audio with a high level interface.
%prep
%autosetup -p1 -n pydub-%{version}
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
export NO_OPENH264=1
%pytest test/test.py
%files %{python_files}
%license LICENSE
%{python_sitelib}/pydub-%{version}.dist-info
%{python_sitelib}/pydub
%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):