Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-audioread for
openSUSE:Factory checked in at 2022-09-25 15:34:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-audioread (Old)
and /work/SRC/openSUSE:Factory/.python-audioread.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-audioread"
Sun Sep 25 15:34:50 2022 rev:9 rq:1005608 version:3.0.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-audioread/python-audioread.changes
2021-12-09 19:46:49.125168189 +0100
+++
/work/SRC/openSUSE:Factory/.python-audioread.new.2275/python-audioread.changes
2022-09-25 15:35:09.695602487 +0200
@@ -1,0 +2,17 @@
+Fri Sep 23 02:28:43 UTC 2022 - Yogalakshmi Arunachalam <[email protected]>
+
+- update to v3.0.0
+ * Merge pull request #114 from Bomme/py36
+ * remove .travis.yml since we have GitHub actions now
+ * install ffmpeg in github action
+ * add a GitHub actions workflow for python tox tests
+ * remove deprecated pytest-runner (fully rely on tox instead)
+ * remove python 2 specific code in gstdec.py
+ * reorganize imports; remove python 2 specific imports
+ * remove python 2.7 from travis.yml
+ * add python_requires to setup.py
+ * remove mention of Python 2 from README.rst
+ * Only list python > 3.6 in setup.py and tox.ini
+ * automatic pyupgrade rewrite
+
+-------------------------------------------------------------------
Old:
----
v2.1.9.tar.gz
New:
----
v3.0.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-audioread.spec ++++++
--- /var/tmp/diff_new_pack.P7xikp/_old 2022-09-25 15:35:10.235603788 +0200
+++ /var/tmp/diff_new_pack.P7xikp/_new 2022-09-25 15:35:10.239603797 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-audioread
#
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-audioread
-Version: 2.1.9
+Version: 3.0.0
Release: 0
Summary: Wrapper for audio decoding via selectable backends
License: MIT
++++++ v2.1.9.tar.gz -> v3.0.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/audioread-2.1.9/.github/workflows/main.yml
new/audioread-3.0.0/.github/workflows/main.yml
--- old/audioread-2.1.9/.github/workflows/main.yml 1970-01-01
01:00:00.000000000 +0100
+++ new/audioread-3.0.0/.github/workflows/main.yml 2022-08-12
22:23:20.000000000 +0200
@@ -0,0 +1,25 @@
+name: Python Tests
+
+on: [push]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python: ["3.6", "3.7", "3.8", "3.9"]
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Setup Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python }}
+ - name: Install ffmpeg
+ run: sudo apt install -y --no-install-recommends ffmpeg
+ - name: Install tox and any other packages
+ run: pip install tox
+ - name: Run tox
+ # Run tox using the version of Python in `PATH`
+ run: tox -e py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/audioread-2.1.9/.travis.yml
new/audioread-3.0.0/.travis.yml
--- old/audioread-2.1.9/.travis.yml 2020-10-20 13:22:05.000000000 +0200
+++ new/audioread-3.0.0/.travis.yml 1970-01-01 01:00:00.000000000 +0100
@@ -1,20 +0,0 @@
-language: python
-arch:
- - ppc64le
- - amd64
-python:
- - "2.7"
- - "3.6"
-
-addons:
- apt:
- sources:
- - trusty-media
- packages:
- - ffmpeg
-
-install:
- - python setup.py install
-
-script:
- - pytest
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/audioread-2.1.9/README.rst
new/audioread-3.0.0/README.rst
--- old/audioread-2.1.9/README.rst 2020-10-20 13:22:05.000000000 +0200
+++ new/audioread-3.0.0/README.rst 2022-08-12 22:23:20.000000000 +0200
@@ -58,8 +58,7 @@
``available_backends`` function to get a list backends that are usable on the
current system.
-Audioread is "universal" and supports both Python 2 (2.6+) and Python 3
-(3.2+).
+Audioread supports Python 3 (3.6+).
Example
-------
@@ -70,8 +69,15 @@
Version History
---------------
+3.0.0
+ Drop support for Python 2 and older versions of Python 3. The library now
+ requires Python 3.6+.
+ Increase default block size in FFmpegAudioFile to get slightly faster file
reading.
+ Cache backends for faster lookup (thanks to @bmcfee).
+ Audio file classes now inherit from a common base ``AudioFile`` class.
+
2.1.9
- Work correctly with GStreamer 1.18 and later (thanks to @ssssam)
+ Work correctly with GStreamer 1.18 and later (thanks to @ssssam).
2.1.8
Fix an unhandled ``OSError`` when FFmpeg is not installed.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/audioread-2.1.9/audioread/__init__.py
new/audioread-3.0.0/audioread/__init__.py
--- old/audioread-2.1.9/audioread/__init__.py 2020-10-20 13:22:05.000000000
+0200
+++ new/audioread-3.0.0/audioread/__init__.py 2022-08-12 22:23:20.000000000
+0200
@@ -17,6 +17,7 @@
from . import ffdec
from .exceptions import DecodeError, NoBackendError
from .version import version as __version__ # noqa
+from .base import AudioFile # noqa
def _gst_available():
@@ -60,8 +61,20 @@
return True
-def available_backends():
- """Returns a list of backends that are available on this system."""
+# A cache for the available backends.
+BACKENDS = []
+
+
+def available_backends(flush_cache=False):
+ """Returns a list of backends that are available on this system.
+
+ The list of backends is cached after the first call.
+ If the parameter `flush_cache` is set to `True`, then the cache
+ will be flushed and the backend list will be reconstructed.
+ """
+
+ if BACKENDS and not flush_cache:
+ return BACKENDS
# Standard-library WAV and AIFF readers.
from . import rawread
@@ -86,7 +99,10 @@
if ffdec.available():
result.append(ffdec.FFmpegAudioFile)
- return result
+ # Cache the backends we found
+ BACKENDS[:] = result
+
+ return BACKENDS
def audio_open(path, backends=None):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/audioread-2.1.9/audioread/base.py
new/audioread-3.0.0/audioread/base.py
--- old/audioread-2.1.9/audioread/base.py 1970-01-01 01:00:00.000000000
+0100
+++ new/audioread-3.0.0/audioread/base.py 2022-08-12 22:23:20.000000000
+0200
@@ -0,0 +1,18 @@
+# This file is part of audioread.
+# Copyright 2021, Adrian Sampson.
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+
+
+class AudioFile:
+ """The base class for all audio file types.
+ """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/audioread-2.1.9/audioread/ffdec.py
new/audioread-3.0.0/audioread/ffdec.py
--- old/audioread-2.1.9/audioread/ffdec.py 2020-10-20 13:22:05.000000000
+0200
+++ new/audioread-3.0.0/audioread/ffdec.py 2022-08-12 22:23:20.000000000
+0200
@@ -16,18 +16,16 @@
output.
"""
-import sys
-import subprocess
+import queue
import re
+import subprocess
+import sys
import threading
import time
-import os
-try:
- import queue
-except ImportError:
- import Queue as queue
+from io import DEFAULT_BUFFER_SIZE
from .exceptions import DecodeError
+from .base import AudioFile
COMMANDS = ('ffmpeg', 'avconv')
@@ -62,7 +60,7 @@
over a Queue.
"""
def __init__(self, fh, blocksize=1024, discard=False):
- super(QueueReaderThread, self).__init__()
+ super().__init__()
self.fh = fh
self.blocksize = blocksize
self.daemon = True
@@ -121,9 +119,9 @@
windows_error_mode_lock = threading.Lock()
-class FFmpegAudioFile(object):
+class FFmpegAudioFile(AudioFile):
"""An audio file decoded by the ffmpeg command-line utility."""
- def __init__(self, filename, block_size=4096):
+ def __init__(self, filename, block_size=DEFAULT_BUFFER_SIZE):
# On Windows, we need to disable the subprocess's crash dialog
# in case it dies. Passing SEM_NOGPFAULTERRORBOX to SetErrorMode
# disables this behavior.
@@ -141,13 +139,12 @@
)
try:
- self.devnull = open(os.devnull)
self.proc = popen_multiple(
COMMANDS,
['-i', filename, '-f', 's16le', '-'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
- stdin=self.devnull,
+ stdin=subprocess.DEVNULL,
creationflags=PROC_FLAGS,
)
@@ -227,7 +224,7 @@
line = line.strip().lower()
if 'no such file' in line:
- raise IOError('file not found')
+ raise OSError('file not found')
elif 'invalid data found' in line:
raise UnsupportedError()
elif 'duration:' in line:
@@ -307,10 +304,6 @@
self.proc.stdout.close()
self.proc.stderr.close()
- # Close the handle to os.devnull, which is opened regardless of if
- # a subprocess is successfully created.
- self.devnull.close()
-
def __del__(self):
self.close()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/audioread-2.1.9/audioread/gstdec.py
new/audioread-3.0.0/audioread/gstdec.py
--- old/audioread-2.1.9/audioread/gstdec.py 2020-10-20 13:22:05.000000000
+0200
+++ new/audioread-3.0.0/audioread/gstdec.py 2022-08-12 22:23:20.000000000
+0200
@@ -45,8 +45,6 @@
>>> print f.channels
>>> print f.duration
"""
-from __future__ import with_statement
-from __future__ import division
import gi
gi.require_version('Gst', '1.0')
@@ -55,19 +53,11 @@
import sys
import threading
import os
+import queue
+from urllib.parse import quote
from .exceptions import DecodeError
-
-try:
- import queue
-except ImportError:
- import Queue as queue
-
-try:
- from urllib.parse import quote
-except ImportError:
- from urllib import quote
-
+from .base import AudioFile
QUEUE_SIZE = 10
BUFFER_SIZE = 10
@@ -83,7 +73,7 @@
class UnknownTypeError(GStreamerError):
"""Raised when Gstreamer can't decode the given file type."""
def __init__(self, streaminfo):
- super(UnknownTypeError, self).__init__(
+ super().__init__(
"can't decode stream: " + streaminfo
)
self.streaminfo = streaminfo
@@ -99,7 +89,7 @@
were found.
"""
def __init__(self):
- super(NoStreamError, self).__init__('no audio streams found')
+ super().__init__('no audio streams found')
class MetadataMissingError(GStreamerError):
@@ -114,7 +104,7 @@
principal plugin packages) are missing.
"""
def __init__(self):
- super(IncompleteGStreamerError, self).__init__(
+ super().__init__(
'missing GStreamer base plugins'
)
@@ -142,7 +132,7 @@
"""A daemon thread encapsulating a Gobject main loop.
"""
def __init__(self):
- super(MainLoopThread, self).__init__()
+ super().__init__()
self.loop = GLib.MainLoop.new(None, False)
self.daemon = True
@@ -152,7 +142,7 @@
# The decoder.
-class GstAudioFile(object):
+class GstAudioFile(AudioFile):
"""Reads raw audio data from any audio file that Gstreamer
knows how to decode.
@@ -200,7 +190,7 @@
# The callback to connect the input.
self.dec.connect("pad-added", self._pad_added)
self.dec.connect("no-more-pads", self._no_more_pads)
- # And a callback if decoding failes.
+ # And a callback if decoding fails.
self.dec.connect("unknown-type", self._unkown_type)
# Configure the output.
@@ -373,7 +363,7 @@
# Iteration.
- def next(self):
+ def __next__(self):
# Wait for data from the Gstreamer callbacks.
val = self.queue.get()
if val == SENTINEL:
@@ -381,9 +371,6 @@
raise StopIteration
return val
- # For Python 3 compatibility.
- __next__ = next
-
def __iter__(self):
return self
@@ -418,11 +405,6 @@
# Halt the pipeline (closing file).
self.pipeline.set_state(Gst.State.NULL)
- # Delete the pipeline object. This seems to be necessary on Python
- # 2, but not Python 3 for some reason: on 3.5, at least, the
- # pipeline gets dereferenced automatically.
- del self.pipeline
-
def __del__(self):
self.close()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/audioread-2.1.9/audioread/macca.py
new/audioread-3.0.0/audioread/macca.py
--- old/audioread-2.1.9/audioread/macca.py 2020-10-20 13:22:05.000000000
+0200
+++ new/audioread-3.0.0/audioread/macca.py 2022-08-12 22:23:20.000000000
+0200
@@ -13,13 +13,14 @@
# included in all copies or substantial portions of the Software.
"""Read audio files using CoreAudio on Mac OS X."""
-import os
-import sys
+import copy
import ctypes
import ctypes.util
-import copy
+import os
+import sys
from .exceptions import DecodeError
+from .base import AudioFile
# CoreFoundation and CoreAudio libraries along with their function
@@ -110,20 +111,20 @@
msg = 'unsupported format'
else:
msg = 'error %i' % code
- super(MacError, self).__init__(msg)
+ super().__init__(msg)
def check(err):
"""If err is nonzero, raise a MacError exception."""
if err == ERROR_NOT_FOUND:
- raise IOError('file not found')
+ raise OSError('file not found')
elif err != 0:
raise MacError(err)
# CoreFoundation objects.
-class CFObject(object):
+class CFObject:
def __init__(self, obj):
if obj == 0:
raise ValueError('object is zero')
@@ -142,7 +143,7 @@
url = _corefoundation.CFURLCreateFromFileSystemRepresentation(
0, filename, len(filename), False
)
- super(CFURL, self).__init__(url)
+ super().__init__(url)
def __str__(self):
cfstr = _corefoundation.CFURLGetString(self._obj)
@@ -184,7 +185,7 @@
# Main functionality.
-class ExtAudioFile(object):
+class ExtAudioFile(AudioFile):
"""A CoreAudio "extended audio file". Reads information and raw PCM
audio data from any file that CoreAudio knows how to decode.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/audioread-2.1.9/audioread/maddec.py
new/audioread-3.0.0/audioread/maddec.py
--- old/audioread-2.1.9/audioread/maddec.py 2020-10-20 13:22:05.000000000
+0200
+++ new/audioread-3.0.0/audioread/maddec.py 2022-08-12 22:23:20.000000000
+0200
@@ -14,14 +14,16 @@
"""Decode MPEG audio files with MAD (via pymad)."""
import mad
+
from . import DecodeError
+from .base import AudioFile
class UnsupportedError(DecodeError):
"""The file is not readable by MAD."""
-class MadAudioFile(object):
+class MadAudioFile(AudioFile):
"""MPEG audio file decoder using the MAD library."""
def __init__(self, filename):
self.fp = open(filename, 'rb')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/audioread-2.1.9/audioread/rawread.py
new/audioread-3.0.0/audioread/rawread.py
--- old/audioread-2.1.9/audioread/rawread.py 2020-10-20 13:22:05.000000000
+0200
+++ new/audioread-3.0.0/audioread/rawread.py 2022-08-12 22:23:20.000000000
+0200
@@ -13,23 +13,20 @@
# included in all copies or substantial portions of the Software.
"""Uses standard-library modules to read AIFF, AIFF-C, and WAV files."""
-import wave
import aifc
-import sunau
import audioop
import struct
-import sys
+import sunau
+import wave
from .exceptions import DecodeError
+from .base import AudioFile
# Produce two-byte (16-bit) output samples.
TARGET_WIDTH = 2
# Python 3.4 added support for 24-bit (3-byte) samples.
-if sys.version_info > (3, 4, 0):
- SUPPORTED_WIDTHS = (1, 2, 3, 4)
-else:
- SUPPORTED_WIDTHS = (1, 2, 4)
+SUPPORTED_WIDTHS = (1, 2, 3, 4)
class UnsupportedError(DecodeError):
@@ -54,7 +51,7 @@
return b''.join(parts)
-class RawAudioFile(object):
+class RawAudioFile(AudioFile):
"""An AIFF, WAV, or Au file that can be read by the Python standard
library modules ``wave``, ``aifc``, and ``sunau``.
"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/audioread-2.1.9/audioread/version.py
new/audioread-3.0.0/audioread/version.py
--- old/audioread-2.1.9/audioread/version.py 2020-10-20 13:22:05.000000000
+0200
+++ new/audioread-3.0.0/audioread/version.py 2022-08-12 22:23:20.000000000
+0200
@@ -14,5 +14,5 @@
"""Version data for the audioread package."""
-version = '2.1.9'
-short_version = '2.1'
+version = '3.0.0'
+short_version = '3.0'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/audioread-2.1.9/decode.py
new/audioread-3.0.0/decode.py
--- old/audioread-2.1.9/decode.py 2020-10-20 13:22:05.000000000 +0200
+++ new/audioread-3.0.0/decode.py 2022-08-12 22:23:20.000000000 +0200
@@ -13,7 +13,6 @@
# included in all copies or substantial portions of the Software.
"""Command-line tool to decode audio files to WAV files."""
-from __future__ import print_function
import audioread
import sys
import os
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/audioread-2.1.9/setup.cfg
new/audioread-3.0.0/setup.cfg
--- old/audioread-2.1.9/setup.cfg 2020-10-20 13:22:05.000000000 +0200
+++ new/audioread-3.0.0/setup.cfg 1970-01-01 01:00:00.000000000 +0100
@@ -1,2 +0,0 @@
-[aliases]
-test=pytest
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/audioread-2.1.9/setup.py new/audioread-3.0.0/setup.py
--- old/audioread-2.1.9/setup.py 2020-10-20 13:22:05.000000000 +0200
+++ new/audioread-3.0.0/setup.py 2022-08-12 22:23:20.000000000 +0200
@@ -36,22 +36,15 @@
packages=['audioread'],
- tests_require=[
- 'pytest-runner',
- 'pytest'
- ],
-
classifiers=[
'Topic :: Multimedia :: Sound/Audio :: Conversion',
'Intended Audience :: Developers',
- 'Programming Language :: Python :: 2',
- 'Programming Language :: Python :: 2.6',
- 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.2',
- 'Programming Language :: Python :: 3.3',
- 'Programming Language :: Python :: 3.4',
- 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
+ 'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.10',
],
+ python_requires='>=3.6',
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/audioread-2.1.9/test/conftest.py
new/audioread-3.0.0/test/conftest.py
--- old/audioread-2.1.9/test/conftest.py 2020-10-20 13:22:05.000000000
+0200
+++ new/audioread-3.0.0/test/conftest.py 2022-08-12 22:23:20.000000000
+0200
@@ -23,7 +23,7 @@
def audiofile(request):
"""Fixture that provides an AudiofileSpec instance."""
spec_path = os.path.join(DATADIR, request.param + '.json')
- with open(spec_path, 'r') as f:
+ with open(spec_path) as f:
spec = json.load(f)
result = AudiofileSpec(**spec)
return result
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/audioread-2.1.9/test/test_audioread.py
new/audioread-3.0.0/test/test_audioread.py
--- old/audioread-2.1.9/test/test_audioread.py 2020-10-20 13:22:05.000000000
+0200
+++ new/audioread-3.0.0/test/test_audioread.py 2022-08-12 22:23:20.000000000
+0200
@@ -13,12 +13,6 @@
# included in all copies or substantial portions of the Software.
-import json
-import os
-import sys
-
-import pytest
-
import audioread
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/audioread-2.1.9/tox.ini new/audioread-3.0.0/tox.ini
--- old/audioread-2.1.9/tox.ini 2020-10-20 13:22:05.000000000 +0200
+++ new/audioread-3.0.0/tox.ini 2022-08-12 22:23:20.000000000 +0200
@@ -1,5 +1,5 @@
[tox]
-envlist = py27,py36
+envlist = py36,py37,py38,py39,py310
[testenv]
deps = pytest