mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
python3Packages.speechrecognition: add optional dependencies
This commit is contained in:
parent
9eea49356e
commit
07544dd438
@ -2,15 +2,17 @@
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
numpy,
|
||||
flac,
|
||||
openai,
|
||||
openai-whisper,
|
||||
pocketsphinx,
|
||||
pyaudio,
|
||||
pytestCheckHook,
|
||||
pythonOlder,
|
||||
torch,
|
||||
requests,
|
||||
setuptools,
|
||||
soundfile,
|
||||
typing-extensions,
|
||||
flac,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
@ -39,26 +41,29 @@ buildPythonPackage rec {
|
||||
build-system = [ setuptools ];
|
||||
|
||||
dependencies = [
|
||||
pyaudio
|
||||
requests
|
||||
typing-extensions
|
||||
];
|
||||
|
||||
optional-dependencies = {
|
||||
whisper-api = [ openai ];
|
||||
whisper-local = [
|
||||
openai-whisper
|
||||
soundfile
|
||||
];
|
||||
};
|
||||
|
||||
nativeCheckInputs = [
|
||||
numpy
|
||||
pytestCheckHook
|
||||
torch
|
||||
soundfile
|
||||
];
|
||||
pocketsphinx
|
||||
] ++ optional-dependencies.whisper-local ++ optional-dependencies.whisper-api;
|
||||
|
||||
pythonImportsCheck = [ "speech_recognition" ];
|
||||
|
||||
disabledTests = [
|
||||
# Test files are missing in source
|
||||
"test_flac"
|
||||
# Attribute error
|
||||
"test_whisper"
|
||||
# PocketSphinx is not available in Nixpkgs
|
||||
"test_sphinx"
|
||||
# Parsed string does not match expected
|
||||
"test_sphinx_keywords"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
|
Loading…
Reference in New Issue
Block a user