about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/speechrecognition/default.nix
blob: 4e50e8260a0f31f2ab4cdc7f371a5fe76748e12a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{ lib
, buildPythonPackage
, fetchFromGitHub
, numpy
, pytestCheckHook
, pythonOlder
, torch
, requests
, setuptools
, soundfile
, typing-extensions
}:

buildPythonPackage rec {
  pname = "speechrecognition";
  version = "3.10.1";
  pyproject = true;

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "Uberi";
    repo = "speech_recognition";
    rev = "refs/tags/${version}";
    hash = "sha256-lO1CW4j5aBnPtemNGsW8cytSa/H+Tb4Jpbfh4Z/0WHk=";
  };

  nativeBuildInputs = [
    setuptools
  ];

  propagatedBuildInputs = [
    requests
    typing-extensions
  ];

  nativeCheckInputs = [
    numpy
    pytestCheckHook
    torch
    soundfile
  ];

  pythonImportsCheck = [
    "speech_recognition"
  ];

  disabledTests = [
    # Test files are missing in source
    "test_flac"
    # Attribute error
    "test_whisper"
    # PocketSphinx is not available in Nixpkgs
    "test_sphinx"
  ];

  meta = with lib; {
    description = "Speech recognition module for Python, supporting several engines and APIs, online and offline";
    homepage = "https://github.com/Uberi/speech_recognition";
    license = with licenses; [ gpl2Only bsd3 ];
    maintainers = with maintainers; [ fab ];
  };
}