From c853e47154cb3a71d78e6469a11403776d655b3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 31 Dec 2021 12:06:07 +0100 Subject: [PATCH] python3.pkgs.gruut: 1.2.3 -> 2.2.0 --- .../python-modules/gruut/default.nix | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/gruut/default.nix b/pkgs/development/python-modules/gruut/default.nix index 75d0c365e610..4718d8244d0c 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 = [