From 16d9c2a5702511b03bb3700fb717060491cc1252 Mon Sep 17 00:00:00 2001 From: Pash Shocky Date: Fri, 6 Dec 2019 18:37:50 +0000 Subject: [PATCH] sacremoses: init at 0.0.35 --- .../python-modules/sacremoses/default.nix | 37 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 39 insertions(+) create mode 100644 pkgs/development/python-modules/sacremoses/default.nix diff --git a/pkgs/development/python-modules/sacremoses/default.nix b/pkgs/development/python-modules/sacremoses/default.nix new file mode 100644 index 000000000000..ef0fcb57dc95 --- /dev/null +++ b/pkgs/development/python-modules/sacremoses/default.nix @@ -0,0 +1,37 @@ +{ buildPythonPackage +, stdenv +, fetchFromGitHub +, click +, six +, tqdm +, joblib +, pytest +}: + +buildPythonPackage rec { + pname = "sacremoses"; + version = "0.0.35"; + + src = fetchFromGitHub { + owner = "alvations"; + repo = pname; + rev = "${version}"; + sha256 = "1gzr56w8yx82mn08wax5m0xyg15ym4ri5l80gmagp8r53443j770"; + }; + + propagatedBuildInputs = [ click six tqdm joblib ]; + + checkInputs = [ pytest ]; + # ignore tests which call to remote host + checkPhase = '' + pytest -k 'not truecase' + ''; + + meta = with stdenv.lib; { + homepage = "https://github.com/alvations/sacremoses"; + description = "Python port of Moses tokenizer, truecaser and normalizer"; + license = licenses.lgpl21Plus; + platforms = [ "x86_64-linux" ]; + maintainers = with maintainers; [ pashashocky ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7efd994ce8b2..6270b4bba332 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1281,6 +1281,8 @@ in { selectors2 = callPackage ../development/python-modules/selectors2 { }; + sacremoses = callPackage ../development/python-modules/sacremoses { }; + sentencepiece = callPackage ../development/python-modules/sentencepiece { inherit (pkgs) sentencepiece pkgconfig; };