about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2022-01-01 00:13:43 +0000
committerGitHub <noreply@github.com>2022-01-01 00:13:43 +0000
commit6c0970d40c34d9428558d210f38b477d9815af9f (patch)
treeceaa3e05a2b7e792973dd377f3131ccbeefc935c
parent796af3ddba8c3b045b79332a39eae92f24efc277 (diff)
parent73fa8d8d9cfdb42af33d84a339b19c2e7f395c85 (diff)
Merge pull request #152929 from Mic92/gruut-ipa
gruut: fix build
-rw-r--r--pkgs/development/python-modules/gruut-ipa/default.nix4
-rw-r--r--pkgs/development/python-modules/gruut/default.nix33
-rw-r--r--pkgs/tools/audio/tts/default.nix7
3 files changed, 32 insertions, 12 deletions
diff --git a/pkgs/development/python-modules/gruut-ipa/default.nix b/pkgs/development/python-modules/gruut-ipa/default.nix
index 4fa9d62b7ac87..ad1da8b2917ab 100644
--- a/pkgs/development/python-modules/gruut-ipa/default.nix
+++ b/pkgs/development/python-modules/gruut-ipa/default.nix
@@ -7,14 +7,14 @@
 
 buildPythonPackage rec {
   pname = "gruut-ipa";
-  version = "0.11.0";
+  version = "0.12.0";
   format = "setuptools";
 
   src = fetchFromGitHub {
     owner = "rhasspy";
     repo = pname;
     rev = "v${version}";
-    sha256 = "08n79v60jhkz5vhychsicjz4bhz8v4gb2djmz5dfdaivyr0h3bsf";
+    sha256 = "sha256-6pMdBKbp++/5321rc8A2euOSXZCHzHg+wmaEaMZ0egw=";
   };
 
   postPatch = ''
diff --git a/pkgs/development/python-modules/gruut/default.nix b/pkgs/development/python-modules/gruut/default.nix
index 75d0c365e610e..4718d8244d0c9 100644
--- a/pkgs/development/python-modules/gruut/default.nix
+++ b/pkgs/development/python-modules/gruut/default.nix
@@ -5,11 +5,15 @@
 , fetchFromGitHub
 , Babel
 , gruut-ipa
+, dateparser
 , jsonlines
 , num2words
 , python-crfsuite
 , dataclasses
 , python
+, networkx
+, glibcLocales
+, pytestCheckHook
 }:
 
 let
@@ -17,6 +21,7 @@ let
     "cs"
     "de"
     "es"
+    "en"
     "fr"
     "it"
     "nl"
@@ -28,19 +33,21 @@ let
 in
 buildPythonPackage rec {
   pname = "gruut";
-  version = "1.2.3";
+  version = "2.2.0";
   format = "setuptools";
 
   src = fetchFromGitHub {
     owner = "rhasspy";
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-qY4xsoVk1hyY9dYmVXaqDRjcShUQmp8VZOzAQNiC6EM=";
+    sha256 = "sha256-9vj3x2IjTso8ksN1cqe5frwg0Y3GhOB6bPWvaBSBOf8=";
   };
 
   postPatch = ''
     substituteInPlace requirements.txt \
-      --replace "Babel~=2.8.0" "Babel"
+      --replace "Babel~=2.8.0" "Babel" \
+      --replace "dateparser~=1.0.0" "dateparser" \
+      --replace "gruut_lang_en~=2.0.0" "gruut_lang_en"
   '';
 
   propagatedBuildInputs = [
@@ -49,16 +56,28 @@ buildPythonPackage rec {
     jsonlines
     num2words
     python-crfsuite
+    dateparser
+    networkx
   ] ++ lib.optionals (pythonOlder "3.7") [
     dataclasses
   ] ++ (map (lang: callPackage ./language-pack.nix {
     inherit lang version format src;
   }) langPkgs);
 
-  checkPhase = ''
-    runHook preCheck
-    ${python.interpreter} -m unittest discover
-    runHook postCheck
+  checkInputs = [ glibcLocales pytestCheckHook ];
+
+  disabledTests = [
+    # https://github.com/rhasspy/gruut/issues/25
+    "test_lexicon_external"
+
+    # requires mishkal library
+    "test_fa"
+    "test_ar"
+    "test_lb"
+  ];
+
+  preCheck = ''
+    export LC_ALL=en_US.utf-8
   '';
 
   pythonImportsCheck = [
diff --git a/pkgs/tools/audio/tts/default.nix b/pkgs/tools/audio/tts/default.nix
index 1a07d2f0c33e3..40399f26998ee 100644
--- a/pkgs/tools/audio/tts/default.nix
+++ b/pkgs/tools/audio/tts/default.nix
@@ -1,7 +1,6 @@
 { lib
 , python3
 , fetchFromGitHub
-, fetchpatch
 }:
 
 # USAGE:
@@ -16,18 +15,19 @@
 
 python3.pkgs.buildPythonApplication rec {
   pname = "tts";
-  version = "0.4.1";
+  version = "0.4.2";
 
   src = fetchFromGitHub {
     owner = "coqui-ai";
     repo = "TTS";
     rev = "v${version}";
-    sha256 = "sha256-ZcQUgr+1XTmXoyf2WNsP8Hept42JTFmKXdo0kcU6QWU=";
+    sha256 = "sha256-8a68iFbqqKwtZvufu1Vnv6hGHIQ3HU34wjuQsmr1NUA=";
   };
 
   postPatch = ''
     sed -i requirements.txt \
       -e 's!librosa==[^"]*!librosa!' \
+      -e 's!gruut\[.*\]~=2.0.0!gruut!' \
       -e 's!mecab-python3==[^"]*!mecab-python3!' \
       -e 's!numba==[^"]*!numba!' \
       -e 's!numpy==[^"]*!numpy!' \
@@ -86,6 +86,7 @@ python3.pkgs.buildPythonApplication rec {
     "test_multiscale_stft_loss"
     # Requires network acccess to download models
     "test_synthesize"
+    "test_run_all_models"
   ];
 
   preCheck = ''