python3Packages.torchaudio: skip the most time-consuming tests (#536703)

This commit is contained in:
Peder Bergebakken Sundt
2026-06-30 13:29:51 +00:00
committed by GitHub
4 changed files with 42 additions and 11 deletions
+15 -6
View File
@@ -38,15 +38,16 @@ in
assert
(lib.elem "ariacast" providers) -> throw "music-assistant: ariacast has not been packaged, yet.";
pythonPackages.buildPythonApplication rec {
pythonPackages.buildPythonApplication (finalAttrs: {
pname = "music-assistant";
version = "2.9.4";
pyproject = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "music-assistant";
repo = "server";
tag = version;
tag = finalAttrs.version;
hash = "sha256-PiSBghhlxknijRqghkO8wn1CB2XqaJrjrvGNvZUlNbo=";
};
@@ -93,7 +94,7 @@ pythonPackages.buildPythonApplication rec {
--replace-fail "except BrokenPipeError, ConnectionResetError:" "except (BrokenPipeError, ConnectionResetError):"
substituteInPlace pyproject.toml \
--replace-fail "0.0.0" "${version}" \
--replace-fail "0.0.0" "${finalAttrs.version}" \
--replace-fail "==" ">="
rm -rv \
@@ -191,7 +192,7 @@ pythonPackages.buildPythonApplication rec {
pytestCheckHook
writableTmpDirAsHomeHook
]
++ lib.concatAttrValues optional-dependencies
++ lib.concatAttrValues finalAttrs.passthru.optional-dependencies
++ (lib.concatMap (provider: providerPackages.${provider} pythonPackages) [
"acoustid_lookup"
"audible"
@@ -237,6 +238,14 @@ pythonPackages.buildPythonApplication rec {
"tests/providers/airplay/test_player.py::test_start_pairing__pin_decision"
];
disabledTests = lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
# RuntimeError: failed to initialize QNNPACK
"test_beat_detection"
"test_extended_analysis_fields"
"test_finalize_returns_audio_analysis_data"
"test_finalize_returns_none_on_early_exit"
];
pythonImportsCheck = [ "music_assistant" ];
passthru = {
@@ -252,7 +261,7 @@ pythonPackages.buildPythonApplication rec {
meta = {
broken = stdenv.hostPlatform.isDarwin;
changelog = "https://github.com/music-assistant/server/releases/tag/${version}";
changelog = "https://github.com/music-assistant/server/releases/tag/${finalAttrs.src.tag}";
description = "Music Assistant is a music library manager for various music sources which can easily stream to a wide range of supported players";
longDescription = ''
Music Assistant is a free, opensource Media library manager that connects to your streaming services and a wide
@@ -267,4 +276,4 @@ pythonPackages.buildPythonApplication rec {
];
mainProgram = "mass";
};
}
})
@@ -1,15 +1,21 @@
{
lib,
stdenv,
fetchurl,
buildPythonPackage,
fetchFromGitHub,
fetchurl,
librosa,
numpy,
pytestCheckHook,
# build-system
setuptools,
# dependencies
numpy,
scipy,
stdenv,
torch,
# tests
librosa,
pytestCheckHook,
writableTmpDirAsHomeHook,
}:
let
@@ -26,6 +32,7 @@ buildPythonPackage (finalAttrs: {
pname = "nnaudio";
version = "0.3.4";
pyproject = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "KinWaiCheuk";
@@ -57,6 +64,11 @@ buildPythonPackage (finalAttrs: {
export NUMBA_CACHE_DIR=$(mktemp -d)
'';
# urllib3.exceptions.MaxRetryError
# On darwin the tests fail to locate the audio files and fallback to downloading them from the
# internet
doCheck = !stdenv.hostPlatform.isDarwin;
disabledTests = [
# AttributeError: module 'scipy.signal' has no attribute 'blackmanharris'
"test_cfp_original[cpu]"
@@ -66,6 +78,7 @@ buildPythonPackage (finalAttrs: {
]
++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
# Test fixture matrix has other values
"test_cqt_1992_v2_linear[cpu]"
"test_cqt_1992_v2_log[cpu]"
];
@@ -126,6 +126,8 @@ buildPythonPackage.override { inherit (torch) stdenv; } (finalAttrs: {
# Very long to run
"AutogradCPUTest"
"TestAutogradLfilterCPU"
"TestWav2Vec2Model"
]
++ lib.optionals (hostPlatform.isLinux && hostPlatform.isAarch64) [
# AssertionError: Tensor-likes are not close!
@@ -19,6 +19,7 @@
buildPythonPackage {
inherit (pkgs.usearch) pname version src;
pyproject = true;
__structuredAttrs = true;
postPatch = ''
substituteInPlace python/usearch/__init__.py \
@@ -59,6 +60,12 @@ buildPythonPackage {
writableTmpDirAsHomeHook
];
disabledTests = lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
# Numerical precision error (AssertionError)
"test_index_clustering"
"test_index_retrieval"
];
meta = {
inherit (pkgs.usearch.meta)
description