diff --git a/pkgs/development/python-modules/pymystem3/default.nix b/pkgs/development/python-modules/pymystem3/default.nix new file mode 100644 index 000000000000..5311d9817528 --- /dev/null +++ b/pkgs/development/python-modules/pymystem3/default.nix @@ -0,0 +1,33 @@ +{ lib +, fetchPypi +, buildPythonPackage +, requests +, flake8 +, mock +, pytest +, mystem +}: + +buildPythonPackage rec { + pname = "pymystem3"; + version = "0.2.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "15gv78m17g958gfka6rr3rg230g6b5ssgk8bfpsp7k2iajhxdbhs"; + }; + + propagatedBuildInputs = [ requests ]; + checkInputs = [ flake8 mock pytest ]; + + postPatch = '' + sed -i 's#^_mystem_info = .*#_mystem_info = ["${mystem}/bin", "${mystem}/bin/mystem"]#' pymystem3/constants.py + ''; + + meta = with lib; { + description = "Python wrapper for the Yandex MyStem 3.1 morpholocial analyzer of the Russian language"; + homepage = https://github.com/nlpub/pymystem3; + license = licenses.mit; + maintainers = with maintainers; [ abbradar ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e21463ab93f9..dcec335eb58a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -637,6 +637,8 @@ in { pure-python-adb-homeassistant = callPackage ../development/python-modules/pure-python-adb-homeassistant { }; + pymystem3 = callPackage ../development/python-modules/pymystem3 { }; + pymysql = callPackage ../development/python-modules/pymysql { }; Pmw = callPackage ../development/python-modules/Pmw { };