14
0
Files
python-pysndfile/python-pysndfile.spec

83 lines
2.8 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-pysndfile
#
# 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
# 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/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python36 1
Name: python-pysndfile
Version: 1.4.4
Release: 0
Summary: Cython wrapper class for reading/writing soundfiles
License: LGPL-3.0-only
Group: Development/Languages/Python
URL: https://forge-2.ircam.fr/roebel/pysndfile
Source: https://files.pythonhosted.org/packages/source/p/pysndfile/pysndfile-%{version}.tar.gz
- Update to 1.4.3: * changed sndio functions to all use PySndfile as context manager. This fixes the problem that the sndfile remains open when an error occurs which may in turn lead to inconsistencies if the sndfile is tried to be rewritten in an exception handler. * fixed PySndfile.read_frames method to properly handle reading frames in parts (previous fix was incomplete) * extended supported commands to change compression level when writing flac and ogg files * fixed PySndfile.read_frames and sndio.read method to properly handle reading frames from the middle of a file * Extended PySndfile class: * support use as context manager * added support for wve, ogg, MPC2000 sampler and RF64 wav files * added support for forcing to return 2D arrays even for mono files * added method to close the file and release all resources. * support reading more frames than present in the file using the fill_value for all values positioned after the end of the file * (no changes in functionality) * added documentation to distributed files * added missing licence file to distribution * thanks @toddrme2178 for patches. * removed cython (a build requirement) from requirements.txt * avoid cython warning and fix language_level in the .pyx source code * add and support pre-release tags in the version number * use hashlib to calculate the README checksum. * fixed support for use with python 2.7 that was broken since 1.3.4 * fixed potential but undesired build dependency of pandoc * added link to explanation for using pysndfile under windows * fixed pandoc problem that does produce non ASCII chars in rst output. * fixed two copy paste bug introduced in 1.3.4 1.3.4 did in fact not work at all :-( * added a check target to the makefile that performs a complete built/install/test cycle to avoid problems as in 1.3.4 * added support for automatic installation of requirements * remove precompiled cython source file and rely on pip requirements to provide cython so that cython compilation will always be possible. * added experimental support for installation on win32 (thanks to Svein Seldal for the contributions). * use expanduser for replacing ~ in filenames * adapted cython source code to avoid all compiler warnings due to deprecated numpy api * removed use of ez_setup.py that is no longer required. * fixed missing command C\_SFC\_SET\_SCALE\_INT\_FLOAT\_WRITE (thanks to Svein Seldal for the bug report and fix) * better documentation of sf\_string-io in sndio.read and sndio.write * limit size of strings to be written such that the written file can always be read back with libsndfile 1.0.28 (which imposes different constraints for different formats) * better error handling when number of channels exceeds channel limit imposed by libsndfile. * sndio module now exposes the dicts: fileformat\_name\_to\_id and fileformat\_id\_to\_name * extended sndio.read with force_2d argument that can be used to force the returned data array to always have 2 dimensions even for mono files. - Drop extra source files of COPYING.txt and COPYING.LESSER.txt, it is now included. - Add patch fix-test-imports.patch to fix the test suite. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pysndfile?expand=0&rev=10
2020-07-03 06:55:03 +00:00
Patch0: fix-test-imports.patch
BuildRequires: %{python_module Cython}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module numpy-devel}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: libsndfile-devel
BuildRequires: python-rpm-macros
Requires: python-numpy
%python_subpackages
%description
pysndfile is a python package providing PySndfile a
Cython wrapper class around libsndfile . PySndfile
provides methods for reading and writing a large variety of soundfile
formats on a variety of plattforms. PySndfile provides a rather complete
access to the different sound file manipulation options that are
available in libsndfile.
Due to the use of libsndfile nearly all sound file formats, (besides mp3
and derived formats) can be read and written with PySndfile.
The interface has been designed such that a rather large subset of the
functionality of libsndfile can be used, notably the reading and writing
of strings into soundfile formats that support these, and a number of
sf\_commands that allow to control the way libsndfile reads and writes
the samples. One of the most important ones is the use of the clipping
command.
%prep
%setup -q -n pysndfile-%{version}
- Update to 1.4.3: * changed sndio functions to all use PySndfile as context manager. This fixes the problem that the sndfile remains open when an error occurs which may in turn lead to inconsistencies if the sndfile is tried to be rewritten in an exception handler. * fixed PySndfile.read_frames method to properly handle reading frames in parts (previous fix was incomplete) * extended supported commands to change compression level when writing flac and ogg files * fixed PySndfile.read_frames and sndio.read method to properly handle reading frames from the middle of a file * Extended PySndfile class: * support use as context manager * added support for wve, ogg, MPC2000 sampler and RF64 wav files * added support for forcing to return 2D arrays even for mono files * added method to close the file and release all resources. * support reading more frames than present in the file using the fill_value for all values positioned after the end of the file * (no changes in functionality) * added documentation to distributed files * added missing licence file to distribution * thanks @toddrme2178 for patches. * removed cython (a build requirement) from requirements.txt * avoid cython warning and fix language_level in the .pyx source code * add and support pre-release tags in the version number * use hashlib to calculate the README checksum. * fixed support for use with python 2.7 that was broken since 1.3.4 * fixed potential but undesired build dependency of pandoc * added link to explanation for using pysndfile under windows * fixed pandoc problem that does produce non ASCII chars in rst output. * fixed two copy paste bug introduced in 1.3.4 1.3.4 did in fact not work at all :-( * added a check target to the makefile that performs a complete built/install/test cycle to avoid problems as in 1.3.4 * added support for automatic installation of requirements * remove precompiled cython source file and rely on pip requirements to provide cython so that cython compilation will always be possible. * added experimental support for installation on win32 (thanks to Svein Seldal for the contributions). * use expanduser for replacing ~ in filenames * adapted cython source code to avoid all compiler warnings due to deprecated numpy api * removed use of ez_setup.py that is no longer required. * fixed missing command C\_SFC\_SET\_SCALE\_INT\_FLOAT\_WRITE (thanks to Svein Seldal for the bug report and fix) * better documentation of sf\_string-io in sndio.read and sndio.write * limit size of strings to be written such that the written file can always be read back with libsndfile 1.0.28 (which imposes different constraints for different formats) * better error handling when number of channels exceeds channel limit imposed by libsndfile. * sndio module now exposes the dicts: fileformat\_name\_to\_id and fileformat\_id\_to\_name * extended sndio.read with force_2d argument that can be used to force the returned data array to always have 2 dimensions even for mono files. - Drop extra source files of COPYING.txt and COPYING.LESSER.txt, it is now included. - Add patch fix-test-imports.patch to fix the test suite. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pysndfile?expand=0&rev=10
2020-07-03 06:55:03 +00:00
%autopatch -p1
%build
export CFLAGS="%{optflags}"
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%check
%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitearch}
$python tests/pysndfile_test.py
}
%files %{python_files}
%doc ChangeLog README.md
- Update to 1.4.3: * changed sndio functions to all use PySndfile as context manager. This fixes the problem that the sndfile remains open when an error occurs which may in turn lead to inconsistencies if the sndfile is tried to be rewritten in an exception handler. * fixed PySndfile.read_frames method to properly handle reading frames in parts (previous fix was incomplete) * extended supported commands to change compression level when writing flac and ogg files * fixed PySndfile.read_frames and sndio.read method to properly handle reading frames from the middle of a file * Extended PySndfile class: * support use as context manager * added support for wve, ogg, MPC2000 sampler and RF64 wav files * added support for forcing to return 2D arrays even for mono files * added method to close the file and release all resources. * support reading more frames than present in the file using the fill_value for all values positioned after the end of the file * (no changes in functionality) * added documentation to distributed files * added missing licence file to distribution * thanks @toddrme2178 for patches. * removed cython (a build requirement) from requirements.txt * avoid cython warning and fix language_level in the .pyx source code * add and support pre-release tags in the version number * use hashlib to calculate the README checksum. * fixed support for use with python 2.7 that was broken since 1.3.4 * fixed potential but undesired build dependency of pandoc * added link to explanation for using pysndfile under windows * fixed pandoc problem that does produce non ASCII chars in rst output. * fixed two copy paste bug introduced in 1.3.4 1.3.4 did in fact not work at all :-( * added a check target to the makefile that performs a complete built/install/test cycle to avoid problems as in 1.3.4 * added support for automatic installation of requirements * remove precompiled cython source file and rely on pip requirements to provide cython so that cython compilation will always be possible. * added experimental support for installation on win32 (thanks to Svein Seldal for the contributions). * use expanduser for replacing ~ in filenames * adapted cython source code to avoid all compiler warnings due to deprecated numpy api * removed use of ez_setup.py that is no longer required. * fixed missing command C\_SFC\_SET\_SCALE\_INT\_FLOAT\_WRITE (thanks to Svein Seldal for the bug report and fix) * better documentation of sf\_string-io in sndio.read and sndio.write * limit size of strings to be written such that the written file can always be read back with libsndfile 1.0.28 (which imposes different constraints for different formats) * better error handling when number of channels exceeds channel limit imposed by libsndfile. * sndio module now exposes the dicts: fileformat\_name\_to\_id and fileformat\_id\_to\_name * extended sndio.read with force_2d argument that can be used to force the returned data array to always have 2 dimensions even for mono files. - Drop extra source files of COPYING.txt and COPYING.LESSER.txt, it is now included. - Add patch fix-test-imports.patch to fix the test suite. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pysndfile?expand=0&rev=10
2020-07-03 06:55:03 +00:00
%license COPYING.LESSER.txt
%{python_sitearch}/*
%changelog