python312Packages.librosa: clean and fix tests

This commit is contained in:
Gaetan Lepage
2024-12-29 14:13:52 +01:00
parent 65b073701a
commit a536753815

View File

@@ -8,7 +8,7 @@
# build-system
setuptools,
# runtime
# dependencies
audioread,
decorator,
joblib,
@@ -41,12 +41,12 @@ buildPythonPackage rec {
src = fetchFromGitHub {
owner = "librosa";
repo = "librosa";
rev = "refs/tags/${version}";
tag = version;
fetchSubmodules = true; # for test data
hash = "sha256-0FbKVAFWmcFTW2dR27nif6hPZeIxFWYF1gTm4BEJZ/Q=";
};
nativeBuildInputs = [ setuptools ];
build-system = [ setuptools ];
patches = [
(fetchpatch2 {
@@ -55,6 +55,13 @@ buildPythonPackage rec {
url = "https://github.com/librosa/librosa/commit/d0a12c87cdff715ffb8ac1c7383bba1031aa71e4.patch";
hash = "sha256-NHuGo4U1FRikb5OIkycQBvuZ+0OdG/VykTcuhXkLUug=";
})
# Fix numpy2 test incompatibilities
# TODO: remove when updating to the next release
(fetchpatch2 {
name = "numpy2-support-tests";
url = "https://github.com/librosa/librosa/commit/7eb0a09e703a72a5979049ec546a522c70285aff.patch";
hash = "sha256-m9UpSDKOAr7qzTtahVQktu259cp8QDYjDChpQV0xuY0=";
})
];
postPatch = ''
@@ -62,7 +69,7 @@ buildPythonPackage rec {
--replace-fail "--cov-report term-missing --cov librosa --cov-report=xml " ""
'';
propagatedBuildInputs = [
dependencies = [
audioread
decorator
joblib
@@ -93,7 +100,7 @@ buildPythonPackage rec {
] ++ optional-dependencies.matplotlib;
preCheck = ''
export HOME=$TMPDIR
export HOME=$(mktemp -d)
'';
disabledTests =
@@ -117,13 +124,19 @@ buildPythonPackage rec {
"test_unknown_axis"
"test_axis_bound_warning"
"test_auto_aspect"
]
++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
# Flaky (numerical comparison fails)
"test_istft_multi"
"test_pitch_shift_multi"
"test_time_stretch_multi"
];
meta = with lib; {
meta = {
description = "Python library for audio and music analysis";
homepage = "https://github.com/librosa/librosa";
changelog = "https://github.com/librosa/librosa/releases/tag/${version}";
license = licenses.isc;
maintainers = with maintainers; [ GuillaumeDesforges ];
license = lib.licenses.isc;
maintainers = with lib.maintainers; [ GuillaumeDesforges ];
};
}