python3Packages.openai-whisper: cleanup (#524946)

This commit is contained in:
Nick Cao
2026-05-27 23:02:46 +00:00
committed by GitHub
2 changed files with 43 additions and 22 deletions
@@ -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 ];
};
}
})
@@ -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";