python3.pkgs.gruut: 1.2.3 -> 2.2.0

This commit is contained in:
Jörg Thalheim 2021-12-31 12:06:07 +01:00
parent 4fdf2679f7
commit c853e47154

View file

@ -5,11 +5,15 @@
, fetchFromGitHub , fetchFromGitHub
, Babel , Babel
, gruut-ipa , gruut-ipa
, dateparser
, jsonlines , jsonlines
, num2words , num2words
, python-crfsuite , python-crfsuite
, dataclasses , dataclasses
, python , python
, networkx
, glibcLocales
, pytestCheckHook
}: }:
let let
@ -17,6 +21,7 @@ let
"cs" "cs"
"de" "de"
"es" "es"
"en"
"fr" "fr"
"it" "it"
"nl" "nl"
@ -28,19 +33,21 @@ let
in in
buildPythonPackage rec { buildPythonPackage rec {
pname = "gruut"; pname = "gruut";
version = "1.2.3"; version = "2.2.0";
format = "setuptools"; format = "setuptools";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "rhasspy"; owner = "rhasspy";
repo = pname; repo = pname;
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-qY4xsoVk1hyY9dYmVXaqDRjcShUQmp8VZOzAQNiC6EM="; sha256 = "sha256-9vj3x2IjTso8ksN1cqe5frwg0Y3GhOB6bPWvaBSBOf8=";
}; };
postPatch = '' postPatch = ''
substituteInPlace requirements.txt \ 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 = [ propagatedBuildInputs = [
@ -49,16 +56,28 @@ buildPythonPackage rec {
jsonlines jsonlines
num2words num2words
python-crfsuite python-crfsuite
dateparser
networkx
] ++ lib.optionals (pythonOlder "3.7") [ ] ++ lib.optionals (pythonOlder "3.7") [
dataclasses dataclasses
] ++ (map (lang: callPackage ./language-pack.nix { ] ++ (map (lang: callPackage ./language-pack.nix {
inherit lang version format src; inherit lang version format src;
}) langPkgs); }) langPkgs);
checkPhase = '' checkInputs = [ glibcLocales pytestCheckHook ];
runHook preCheck
${python.interpreter} -m unittest discover disabledTests = [
runHook postCheck # 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 = [ pythonImportsCheck = [