diff -Nru pysoundfile-0.10.1/debian/changelog pysoundfile-0.10.3+post1/debian/changelog --- pysoundfile-0.10.1/debian/changelog 2019-09-04 13:05:12.000000000 +0000 +++ pysoundfile-0.10.3+post1/debian/changelog 2020-01-08 10:32:36.000000000 +0000 @@ -1,3 +1,16 @@ +pysoundfile (0.10.3+post1-1) unstable; urgency=medium + + * New upstream version 0.10.3+post1 + [ IOhannes m zmölnig ] + * Drop patches applied upstream + * Update d/watch to handle "post" suffix + * Refresh d/copyright_hints + + [ Ondřej Nový ] + * Bump Standards-Version to 4.4.1 + + -- IOhannes m zmölnig (Debian/GNU) Wed, 08 Jan 2020 11:32:36 +0100 + pysoundfile (0.10.1-4) unstable; urgency=medium [ Ondřej Nový ] diff -Nru pysoundfile-0.10.1/debian/control pysoundfile-0.10.3+post1/debian/control --- pysoundfile-0.10.1/debian/control 2019-09-04 13:05:12.000000000 +0000 +++ pysoundfile-0.10.3+post1/debian/control 2020-01-08 10:32:36.000000000 +0000 @@ -17,7 +17,7 @@ libsndfile1, python3-sphinx, python3-sphinx-rtd-theme, Testsuite: autopkgtest-pkg-python -Standards-Version: 4.4.0 +Standards-Version: 4.4.1 Rules-Requires-Root: no Homepage: https://github.com/bastibe/PySoundFile Vcs-Git: https://salsa.debian.org/multimedia-team/pysoundfile.git diff -Nru pysoundfile-0.10.1/debian/copyright_hints pysoundfile-0.10.3+post1/debian/copyright_hints --- pysoundfile-0.10.1/debian/copyright_hints 2019-09-04 13:05:12.000000000 +0000 +++ pysoundfile-0.10.3+post1/debian/copyright_hints 2020-01-08 10:32:36.000000000 +0000 @@ -5,8 +5,6 @@ Disclaimer: Autogenerated by licensecheck Files: build_wheels.py - debian/changelog - debian/compat debian/control debian/docs debian/git-tuneclone.sh @@ -33,3 +31,8 @@ License: BSD-3-clause FIXME +Files: debian/changelog +Copyright: Use https protocol in Format field +License: UNKNOWN + FIXME + diff -Nru pysoundfile-0.10.1/debian/patches/py37_compat.patch pysoundfile-0.10.3+post1/debian/patches/py37_compat.patch --- pysoundfile-0.10.1/debian/patches/py37_compat.patch 2019-09-04 13:05:12.000000000 +0000 +++ pysoundfile-0.10.3+post1/debian/patches/py37_compat.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -Description: fixed imports for python3.7 -Author: IOhannes m zmölnig -Origin: Debian -Last-Update: 2018-12-02 ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- pysoundfile.orig/doc/fake__soundfile.py -+++ pysoundfile/doc/fake__soundfile.py -@@ -1,6 +1,10 @@ - """Mock module for Sphinx autodoc.""" - - import ctypes -+try: -+ import ctypes.util -+except Exception: -+ pass - - # Monkey-patch ctypes to disable searching for libsndfile - ctypes.util.find_library = lambda _: NotImplemented diff -Nru pysoundfile-0.10.1/debian/patches/series pysoundfile-0.10.3+post1/debian/patches/series --- pysoundfile-0.10.1/debian/patches/series 2019-09-04 13:05:12.000000000 +0000 +++ pysoundfile-0.10.3+post1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -py37_compat.patch diff -Nru pysoundfile-0.10.1/debian/watch pysoundfile-0.10.3+post1/debian/watch --- pysoundfile-0.10.1/debian/watch 2019-09-04 13:05:12.000000000 +0000 +++ pysoundfile-0.10.3+post1/debian/watch 2020-01-08 10:32:36.000000000 +0000 @@ -1,4 +1,4 @@ # process this file with uscan(1) -version=3 -opts=dversionmangle=s/~dfsg(\.[0-9]*)?$//,filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/PySoundFile-$1\.tar\.gz/ \ +version=4 +opts=uversionmangle=s/(post[0-9]*)/+$1/,dversionmangle=auto,filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/PySoundFile-$1\.tar\.gz/ \ https://github.com/bastibe/PySoundFile/tags .*/v?(\d\S*)\.tar\.gz diff -Nru pysoundfile-0.10.1/doc/fake__soundfile.py pysoundfile-0.10.3+post1/doc/fake__soundfile.py --- pysoundfile-0.10.1/doc/fake__soundfile.py 2018-03-02 13:25:46.000000000 +0000 +++ pysoundfile-0.10.3+post1/doc/fake__soundfile.py 2019-11-27 07:35:01.000000000 +0000 @@ -1,6 +1,7 @@ """Mock module for Sphinx autodoc.""" import ctypes +import ctypes.util # Monkey-patch ctypes to disable searching for libsndfile ctypes.util.find_library = lambda _: NotImplemented diff -Nru pysoundfile-0.10.1/README.rst pysoundfile-0.10.3+post1/README.rst --- pysoundfile-0.10.1/README.rst 2018-03-02 13:25:46.000000000 +0000 +++ pysoundfile-0.10.3+post1/README.rst 2019-11-27 07:35:01.000000000 +0000 @@ -1,6 +1,10 @@ SoundFile ========= +|version| |python| |status| |license| + +|contributors| |downloads| + `SoundFile `__ is an audio library based on libsndfile, CFFI and NumPy. Full documentation is available on http://pysoundfile.readthedocs.org/. @@ -18,6 +22,19 @@ | (c) 2013, Bastian Bechtold +|open-issues| |closed-issues| |open-prs| |closed-prs| + +.. |contributors| image:: https://img.shields.io/github/contributors/bastibe/soundfile.svg +.. |version| image:: https://img.shields.io/pypi/v/soundfile.svg +.. |python| image:: https://img.shields.io/pypi/pyversions/soundfile.svg +.. |license| image:: https://img.shields.io/github/license/bastibe/soundfile.svg +.. |downloads| image:: https://img.shields.io/pypi/dm/soundfile.svg +.. |open-issues| image:: https://img.shields.io/github/issues/bastibe/soundfile.svg +.. |closed-issues| image:: https://img.shields.io/github/issues-closed/bastibe/soundfile.svg +.. |open-prs| image:: https://img.shields.io/github/issues-pr/bastibe/soundfile.svg +.. |closed-prs| image:: https://img.shields.io/github/issues-pr-closed/bastibe/soundfile.svg +.. |status| image:: https://img.shields.io/pypi/status/soundfile.svg + Breaking Changes ---------------- diff -Nru pysoundfile-0.10.1/setup.py pysoundfile-0.10.3+post1/setup.py --- pysoundfile-0.10.1/setup.py 2018-03-02 13:25:46.000000000 +0000 +++ pysoundfile-0.10.3+post1/setup.py 2019-11-27 07:35:01.000000000 +0000 @@ -87,7 +87,7 @@ setup( name='SoundFile', - version='0.10.1', + version='0.10.3post1', description='An audio library based on libsndfile, CFFI and NumPy', author='Bastian Bechtold', author_email='basti@bastibe.de', @@ -118,6 +118,7 @@ 'Topic :: Multimedia :: Sound/Audio', ], long_description=open('README.rst').read(), + long_description_content_type="text/x-rst", tests_require=['pytest'], cmdclass=cmdclass, ) diff -Nru pysoundfile-0.10.1/soundfile.py pysoundfile-0.10.3+post1/soundfile.py --- pysoundfile-0.10.1/soundfile.py 2018-03-02 13:25:46.000000000 +0000 +++ pysoundfile-0.10.3+post1/soundfile.py 2019-11-27 07:35:01.000000000 +0000 @@ -8,7 +8,7 @@ For further information, see http://pysoundfile.readthedocs.org/. """ -__version__ = "0.10.0" +__version__ = "0.10.3" import os as _os import sys as _sys @@ -402,6 +402,8 @@ duration = "{0:.0g}:{1:02.0g}:{2:05.3f} h".format(hours, minutes, seconds) elif minutes >= 1: duration = "{0:02.0g}:{1:05.3f} min".format(minutes, seconds) + elif seconds <= 1: + duration = "{0:d} samples".format(self.frames) else: duration = "{0:.3f} s".format(seconds) return duration @@ -614,6 +616,9 @@ >>> assert myfile.closed """ + # resolve PathLike objects (see PEP519 for details): + # can be replaced with _os.fspath(file) for Python >= 3.6 + file = file.__fspath__() if hasattr(file, '__fspath__') else file self._name = file if mode is None: mode = getattr(file, 'mode', None) @@ -1290,8 +1295,8 @@ try: return _ffi_types[dtype] except KeyError: - raise ValueError("dtype must be one of {0!r}".format( - sorted(_ffi_types.keys()))) + raise ValueError("dtype must be one of {0!r} and not {1!r}".format( + sorted(_ffi_types.keys()), dtype)) def _array_io(self, action, array, frames): """Check array and call low-level IO function.""" diff -Nru pysoundfile-0.10.1/tests/test_pysoundfile.py pysoundfile-0.10.3+post1/tests/test_pysoundfile.py --- pysoundfile-0.10.1/tests/test_pysoundfile.py 2018-03-02 13:25:46.000000000 +0000 +++ pysoundfile-0.10.3+post1/tests/test_pysoundfile.py 2019-11-27 07:35:01.000000000 +0000 @@ -6,6 +6,8 @@ import pytest import cffi import sys +import gc +import weakref # floating point data is typically limited to the interval [-1.0, 1.0], # but smaller/larger values are supported as well @@ -21,8 +23,11 @@ filename_new = 'tests/delme.please' -open_variants = 'name', 'fd', 'obj' - +if sys.version_info >= (3, 6): + import pathlib + open_variants = 'name', 'fd', 'obj', 'pathlib' +else: + open_variants = 'name', 'fd', 'obj' xfail_from_buffer = pytest.mark.xfail(cffi.__version_info__ < (0, 9), reason="from_buffer() since CFFI 0.9") @@ -31,6 +36,8 @@ def _file_existing(request, filename, fdarg, objarg=None): if request.param == 'name': return filename + if request.param == 'pathlib': + return pathlib.Path(filename) elif request.param == 'fd': fd = os.open(filename, fdarg) @@ -660,7 +667,8 @@ @pytest.mark.parametrize("use_default", [True, False]) def test_truncate(file_stereo_rplus, use_default): - if isinstance(file_stereo_rplus, (str, int)): + if (isinstance(file_stereo_rplus, (str, int)) + or hasattr(file_stereo_rplus, '__fspath__')): with sf.SoundFile(file_stereo_rplus, 'r+', closefd=False) as f: if use_default: f.seek(2) @@ -884,6 +892,14 @@ assert "closed" in str(excinfo.value) +def test_garbage(file_stereo_r): + f = sf.SoundFile(file_stereo_r) + ref = weakref.ref(f) + f = None + gc.collect() + assert ref() is None + + def test_file_attributes_should_save_to_disk(file_w): with sf.SoundFile(file_w, 'w', 44100, 2, format='WAV') as f: f.title = 'testing' diff -Nru pysoundfile-0.10.1/.travis.yml pysoundfile-0.10.3+post1/.travis.yml --- pysoundfile-0.10.1/.travis.yml 2018-03-02 13:25:46.000000000 +0000 +++ pysoundfile-0.10.3+post1/.travis.yml 2019-11-27 07:35:01.000000000 +0000 @@ -1,23 +1,20 @@ language: python python: - - "2.6" - "2.7" - - "3.2" - - "3.3" - "3.4" - "3.5" - "3.6" + - "3.7" - "nightly" - - "pypy-5.3.1" - - "pypy-5.4.1" - # TODO: Enable pypy3 once NumPy is working there, see - # https://bitbucket.org/pypy/pypy/issues/1567/ + - "pypy" + # TODO: Enable pypy3 once NumPy is working there, see + # https://bitbucket.org/pypy/pypy/issues/1567/ #- "pypy3" addons: apt: packages: - libsndfile1 install: - - "if [[ $TRAVIS_PYTHON_VERSION == pypy* ]]; then pip install git+https://bitbucket.org/pypy/numpy.git ; fi" + - "if [[ $TRAVIS_PYTHON_VERSION == pypy ]]; then pip install git+https://bitbucket.org/pypy/numpy.git ; fi" script: - python setup.py test