15
0

enable sle15_python_module_pythons

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-SoundFile?expand=0&rev=20
This commit is contained in:
2024-10-25 14:49:33 +00:00
committed by Git OBS Bridge
commit c1abdc51d8
7 changed files with 244 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

View File

@@ -0,0 +1,34 @@
From 177f1fa06472f0b384e876a545060da6d4985d9a Mon Sep 17 00:00:00 2001
From: yeey <gyee@suse.com>
Date: Sat, 28 Sep 2024 20:14:02 -0700
Subject: [PATCH] Fix libsndfile versioning
Strip the "-exp" from the libsndfile version since _sound_file data
binary build is optional.
---
soundfile.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/soundfile.py b/soundfile.py
index cc13192..9012d78 100644
--- a/soundfile.py
+++ b/soundfile.py
@@ -10,6 +10,7 @@ For further information, see https://python-soundfile.readthedocs.io/.
"""
__version__ = "0.12.1"
+import re as _re
import os as _os
import sys as _sys
from os import SEEK_SET, SEEK_CUR, SEEK_END
@@ -194,6 +195,7 @@ except (OSError, ImportError, TypeError):
__libsndfile_version__ = _ffi.string(_snd.sf_version_string()).decode('utf-8', 'replace')
if __libsndfile_version__.startswith('libsndfile-'):
__libsndfile_version__ = __libsndfile_version__[len('libsndfile-'):]
+__libsndfile_version__ = _re.sub('-.*$', '', __libsndfile_version__)
def read(file, frames=-1, start=0, stop=None, dtype='float64', always_2d=False,
--
2.45.2

99
python-SoundFile.changes Normal file
View File

@@ -0,0 +1,99 @@
-------------------------------------------------------------------
Sun Sep 29 03:20:29 UTC 2024 - Guang Yee <gyee@suse.com>
- Add 0001-Fix-libsndfile-versioning.patch
* Fix the libsndfile version by stripping the "-exp" postfix.
-------------------------------------------------------------------
Sat Sep 28 18:17:04 UTC 2024 - Guang Yee <gyee@suse.com>
- Enable sle15_python_module_pythons.
-------------------------------------------------------------------
Sat Apr 1 11:53:26 UTC 2023 - Ben Greiner <code@bnavigator.de>
- Update to 0.12.1
* Fixes a bug in the library discover on Linux, if no system
library and no packaged library could be found.
- Release 0.12.0
* Updated libsndfile to v1.2.0
* Improves precompiled library location, especially with py2app
or cx-freeze.
* Now provide binary wheels for Linux x86_64
* Now prefers packaged libsndfile over system-installed
libsndfile
- Release 0.11.0
* MP3 support
* Updates libsndfile to v1.1.0
* Adds get_strings method for retrieving all metadata at once
* Improves documentation, error messages and tests
* Displays length of very short files in samples
* Supports the file system path protocol (pathlib et al)
-------------------------------------------------------------------
Fri Feb 19 17:24:38 UTC 2021 - Ben Greiner <code@bnavigator.de>
- Don't install and test optional numpy on python36 flavor,
because NumPy 1.20 on Tumbleweed does not support Python 3.6
anymore (NEP 29)
-------------------------------------------------------------------
Wed Mar 4 11:07:43 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Fix pytest dependency
-------------------------------------------------------------------
Mon Dec 2 16:28:38 UTC 2019 - Todd R <toddrme2178@gmail.com>
- Update to 0.10.3.post1
* Update Python versions in .travis.yml
* improve _check_dtype exception
* add display sound file length in samples
-------------------------------------------------------------------
Thu Nov 7 15:49:40 UTC 2019 - Matej Cepl <mcepl@suse.com>
- Run through spec-cleaner
-------------------------------------------------------------------
Fri Aug 9 16:10:14 UTC 2019 - Todd R <toddrme2178@gmail.com>
- Restrict pytest version to fix tests.
-------------------------------------------------------------------
Fri Aug 17 09:02:13 UTC 2018 - tchvatal@suse.com
- Sort out the header a bit
- Remove test conditional, always run tests
- Mark the package as noarch (as it is)
* one test is failing on i586, but it is bug in libsndfile, disabled for now
ret [ 32767, -32768, -32767, -1, -1, 0, 0, 0, 1, 1, 32766, 32767, 32767]
exp (-32768, -32768, -32767, -1, -1, 0, 0, 0, 1, 1, 32766, 32767, 32767)
https://github.com/bastibe/SoundFile/issues/185
-------------------------------------------------------------------
Fri May 18 20:51:12 UTC 2018 - jengelh@inai.de
- Do not repeat other packages' metadata in description.
-------------------------------------------------------------------
Wed May 9 01:09:10 UTC 2018 - toddrme2178@gmail.com
- Update to 0.10.2
* Should now work with cx_freeze.
* Several documentation fixes in the README.
* Removes deprecated ctype argument in favor of dtype in buffer_*().
* Adds SoundFile.frames in favor of now-deprecated __len__().
* Improves performance of blocks and SoundFile.blocks().
* Improves import time by using CFFI's out of line mode.
* Adds a build script for building distributions.
-------------------------------------------------------------------
Wed Aug 9 14:05:47 UTC 2017 - toddrme2178@gmail.com
- Not compatible with some architectures
-------------------------------------------------------------------
Tue Aug 8 19:39:24 UTC 2017 - toddrme2178@gmail.com
- Initial version

View File

@@ -0,0 +1,2 @@
# pure python script uses dlopen()
addFilter("explicit-lib-dependency libsndfile[0-9]+")

82
python-SoundFile.spec Normal file
View File

@@ -0,0 +1,82 @@
#
# spec file for package python-SoundFile
#
# Copyright (c) 2023 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/
#
%{?sle15_python_module_pythons}
Name: python-SoundFile
Version: 0.12.1
Release: 0
Summary: An audio library based on libsndfile, CFFI and NumPy
License: BSD-3-Clause
URL: https://github.com/bastibe/python-soundfile
Source: https://files.pythonhosted.org/packages/source/s/soundfile/soundfile-%{version}.tar.gz
Source99: python-SoundFile.rpmlintrc
Patch0: 0001-Fix-libsndfile-versioning.patch
BuildRequires: %{python_module cffi >= 1.0}
BuildRequires: %{python_module numpy}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: libsndfile-devel
BuildRequires: python-rpm-macros
BuildArch: noarch
Requires: python-cffi >= 1.0
Requires: %(rpm -q --requires libsndfile-devel | grep -o 'libsndfile[0-9]*')
Recommends: python-numpy
Obsoletes: python-PySoundFile < %{version}
Provides: python-PySoundFile = %{version}
Provides: python-soundfile = %{version}
%python_subpackages
%description
PySoundFile is an audio library based on libsndfile, CFFI and NumPy.
Full documentation is available on http://pysoundfile.readthedocs.org/.
PySoundFile can read and write sound files. File reading/writing is
supported through libsndfile, which itself is accessed through CFFI,
a foreign function interface for Python calling C code. PySoundFile
represents audio data as NumPy arrays.
%prep
%setup -q -n soundfile-%{version}
%autopatch -p1
%build
# force a pure wheel through unknown platform
# (we do not bundle the libs anyway)
export PYSOUNDFILE_PLATFORM="OBS"
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%pytest
%files %{python_files}
%doc README.rst
%license LICENSE
%{python_sitelib}/soundfile-%{version}.dist-info
%{python_sitelib}/soundfile.py
%{python_sitelib}/_soundfile.py
%pycache_only %{python_sitelib}/__pycache__/soundfile*.pyc
%pycache_only %{python_sitelib}/__pycache__/_soundfile*.pyc
%changelog

3
soundfile-0.12.1.tar.gz Normal file
View File

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