Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / fugashi / default.nix
blob264771ed5a4b3be356a8123ca22efb25109f8392
1 { lib
2 , fetchFromGitHub
3 , pythonOlder
4 , pytestCheckHook
5 , buildPythonPackage
6 , cython
7 , mecab
8 , setuptools-scm
9 , ipadic
10 , unidic
11 , unidic-lite
14 buildPythonPackage rec {
15   pname = "fugashi";
16   version = "1.3.0";
17   format = "setuptools";
18   disabled = pythonOlder "3.7";
20   src = fetchFromGitHub {
21     owner = "polm";
22     repo = "fugashi";
23     rev = "refs/tags/v${version}";
24     hash = "sha256-4i7Q+TtXTQNSJ1EIcS8KHrVPdCJAgZh86Y6lB8772XU=";
25   };
27   SETUPTOOLS_SCM_PRETEND_VERSION = version;
29   nativeBuildInputs = [ cython mecab setuptools-scm ];
31   nativeCheckInputs = [ ipadic pytestCheckHook ]
32     ++ passthru.optional-dependencies.unidic-lite;
34   passthru.optional-dependencies = {
35     unidic-lite = [ unidic-lite ];
36     unidic = [ unidic ];
37   };
39   preCheck = ''
40     cd fugashi
41   '';
43   pythonImportsCheck = [ "fugashi" ];
45   meta = with lib; {
46     description = "A Cython MeCab wrapper for fast, pythonic Japanese tokenization and morphological analysis";
47     homepage = "https://github.com/polm/fugashi";
48     changelog = "https://github.com/polm/fugashi/releases/tag/${version}";
49     license = licenses.mit;
50     maintainers = with maintainers; [ laurent-f1z1 ];
51   };