summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pkuseg/default.nix
blob: a74da172d232ace63e066c3e2f14cf0bb8840cd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
  lib,
  buildPythonPackage,
  fetchPypi,
  isPy3k,
  pythonAtLeast,
  cython,
  numpy,
}:

buildPythonPackage rec {
  pname = "pkuseg";
  version = "0.0.25";
  format = "setuptools";

  disabled = !isPy3k || pythonAtLeast "3.9";

  src = fetchPypi {
    inherit pname version;
    sha256 = "148yp0l7h8cflxag62pc1iwj5b5liyljnaxwfjaiqwl96vwjn0fx";
  };

  # Does not seem to have actual tests, but unittest discover
  # recognizes some non-tests as tests and fails.
  doCheck = false;

  nativeBuildInputs = [ cython ];

  propagatedBuildInputs = [ numpy ];

  pythonImportsCheck = [ "pkuseg" ];

  meta = {
    description = "Toolkit for multi-domain Chinese word segmentation";
    homepage = "https://github.com/lancopku/pkuseg-python";
    license = lib.licenses.unfree;
  };
}