diff --git a/pkgs/development/python-modules/openai-whisper/default.nix b/pkgs/development/python-modules/openai-whisper/default.nix index b15bcefd1503..0fa011ac0a75 100644 --- a/pkgs/development/python-modules/openai-whisper/default.nix +++ b/pkgs/development/python-modules/openai-whisper/default.nix @@ -26,15 +26,16 @@ writableTmpDirAsHomeHook, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "whisper"; version = "20250625"; pyproject = true; + __structuredAttrs = true; src = fetchFromGitHub { owner = "openai"; repo = "whisper"; - rev = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-Zn2HUCor1eCJBP7q0vpffqhw5SNguz8zCGoPgdt6P+c="; }; @@ -76,11 +77,11 @@ buildPythonPackage rec { ]; meta = { - changelog = "https://github.com/openai/whisper/blob/v${version}/CHANGELOG.md"; + changelog = "https://github.com/openai/whisper/blob/${finalAttrs.src.tag}/CHANGELOG.md"; description = "General-purpose speech recognition model"; mainProgram = "whisper"; homepage = "https://github.com/openai/whisper"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ MayNiklas ]; }; -} +}) diff --git a/pkgs/development/python-modules/speechrecognition/default.nix b/pkgs/development/python-modules/speechrecognition/default.nix index 5b4fa1d28b36..cb82eeea2a30 100644 --- a/pkgs/development/python-modules/speechrecognition/default.nix +++ b/pkgs/development/python-modules/speechrecognition/default.nix @@ -2,31 +2,49 @@ lib, buildPythonPackage, fetchFromGitHub, - cacert, - cohere, - faster-whisper, + flac, - google-cloud-speech, - groq, - httpx, - openai-whisper, - openai, - pocketsphinx, - pyaudio, - pytest-httpserver, - pytestCheckHook, - requests, - respx, + + # build-system setuptools, - soundfile, + + # dependencies standard-aifc, typing-extensions, + + # optional-dependencies + # assemblyai + requests, + # audio + pyaudio, + # cohere + cohere, + # faster-whisper + faster-whisper, + # google-cloud + google-cloud-speech, + # grok + groq, + httpx, + # openai + openai, + # pocketsphinx + pocketsphinx, + # whisper-local + openai-whisper, + soundfile, + + # tests + pytest-httpserver, + pytestCheckHook, + respx, }: buildPythonPackage (finalAttrs: { pname = "speechrecognition"; version = "3.16.1"; pyproject = true; + __structuredAttrs = true; src = fetchFromGitHub { owner = "Uberi"; @@ -35,8 +53,8 @@ buildPythonPackage (finalAttrs: { hash = "sha256-5BTwUzo2U7/VwmEqldxXddt/ByKebZKY1KhCEoIb9F8="; }; + # Remove Bundled binaries postPatch = '' - # Remove Bundled binaries rm speech_recognition/flac-* rm -r third-party @@ -75,12 +93,12 @@ buildPythonPackage (finalAttrs: { nativeCheckInputs = [ groq + pocketsphinx pytest-httpserver pytestCheckHook - pocketsphinx respx ] - ++ lib.flatten (builtins.attrValues finalAttrs.passthru.optional-dependencies); + ++ lib.concatAttrValues finalAttrs.passthru.optional-dependencies; pythonImportsCheck = [ "speech_recognition" ]; @@ -94,6 +112,8 @@ buildPythonPackage (finalAttrs: { "tests/recognizers/test_vosk.py" ]; + __darwinAllowLocalNetworking = true; + meta = { description = "Speech recognition module for Python, supporting several engines and APIs, online and offline"; homepage = "https://github.com/Uberi/speech_recognition";