librewolf: 132.0.1 -> 132.0.1-1 (#355483)
[NixPkgs.git] / pkgs / by-name / wh / whisper-ctranslate2 / package.nix
blob389d6f0daf0de9344242c3c3a168fbf7df96fcc8
2   lib,
3   python3,
4   python3Packages,
5   fetchFromGitHub,
6   nix-update-script,
7 }:
8 let
9   pname = "whisper-ctranslate2";
10   version = "0.4.6";
12 python3Packages.buildPythonApplication {
13   inherit pname version;
14   pyproject = true;
16   src = fetchFromGitHub {
17     owner = "Softcatala";
18     repo = "whisper-ctranslate2";
19     rev = "refs/tags/${version}";
20     hash = "sha256-sIkZIzSGqPbjg9BMkcciGFr024Pd8ohXl/NdbsxhjH0=";
21   };
23   build-system = [ python3Packages.setuptools ];
25   dependencies = with python3Packages; [
26     ctranslate2
27     faster-whisper
28     numpy
29     pyannote-audio
30     sounddevice
31     tqdm
32   ];
34   nativeCheckInputs = with python3Packages; [
35     nose2
36   ];
38   checkPhase = ''
39     runHook preCheck
40     # Note: we are not running the `e2e-tests` because they require downloading models from the internet.
41     ${python3.interpreter} -m nose2 -s tests
42     runHook postCheck
43   '';
45   passthru.updateScript = nix-update-script { };
47   meta = {
48     description = "Whisper command line client compatible with original OpenAI client based on CTranslate2";
49     homepage = "https://github.com/Softcatala/whisper-ctranslate2";
50     changelog = "https://github.com/Softcatala/whisper-ctranslate2/releases/tag/${version}";
51     license = lib.licenses.mit;
52     maintainers = with lib.maintainers; [ happysalada ];
53     mainProgram = "whisper-ctranslate2";
54   };