From ec011628ed11e0764fa39b33160be085716c2198 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 5 Feb 2025 23:09:25 +0100 Subject: [PATCH] python313Packages.speechrecognition: fix tests Provides the missing optional-dependencies to complete the tests. --- .../speechrecognition/default.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/speechrecognition/default.nix b/pkgs/development/python-modules/speechrecognition/default.nix index 5821ee05a010..c28f04c67c72 100644 --- a/pkgs/development/python-modules/speechrecognition/default.nix +++ b/pkgs/development/python-modules/speechrecognition/default.nix @@ -2,7 +2,10 @@ lib, buildPythonPackage, fetchFromGitHub, + cacert, + faster-whisper, flac, + google-cloud-speech, groq, httpx, openai-whisper, @@ -15,6 +18,7 @@ respx, setuptools, soundfile, + standard-aifc, typing-extensions, }: @@ -43,11 +47,16 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = [ typing-extensions ]; + dependencies = [ + standard-aifc + typing-extensions + ]; optional-dependencies = { assemblyai = [ requests ]; audio = [ pyaudio ]; + faster-whisper = [ faster-whisper ]; + google-cloud = [ google-cloud-speech ]; groq = [ groq httpx @@ -68,7 +77,12 @@ buildPythonPackage rec { pytestCheckHook pocketsphinx respx - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] ++ lib.flatten (lib.attrValues optional-dependencies); + + preCheck = '' + # httpx since 0.28.0+ depends on SSL_CERT_FILE + SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt + ''; pythonImportsCheck = [ "speech_recognition" ];