about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/wikipedia2vec/default.nix
blob: 12f7ef753a59e6336f800d45f4020756aa24db76 (plain) (blame)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{ lib
, buildPythonPackage
, click
, cython_3
, fetchFromGitHub
, jieba
, joblib
, lmdb
, marisa-trie
, mwparserfromhell
, numpy
, pythonOlder
, scipy
, setuptools
, tqdm
}:

buildPythonPackage rec {
  pname = "wikipedia2vec";
  version = "2.0.0";
  pyproject = true;

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "wikipedia2vec";
    repo = "wikipedia2vec";
    rev = "refs/tags/v${version}";
    hash = "sha256-vrBLlNm0bVIStSBWDHRCtuRpazu8JMCtBl4qJPtHGvU=";
  };

  nativeBuildInputs = [
    cython_3
    setuptools
  ];

  propagatedBuildInputs = [
    click
    cython_3
    jieba
    joblib
    lmdb
    marisa-trie
    mwparserfromhell
    numpy
    scipy
    tqdm
  ];

  preBuild = ''
    bash cythonize.sh
  '';

  pythonImportsCheck = [
    "wikipedia2vec"
  ];

  meta = with lib; {
    description = "Tool for learning vector representations of words and entities from Wikipedia";
    mainProgram = "wikipedia2vec";
    homepage = "https://wikipedia2vec.github.io/wikipedia2vec/";
    changelog = "https://github.com/wikipedia2vec/wikipedia2vec/releases/tag/v${version}";
    license = licenses.asl20;
    maintainers = with maintainers; [ derdennisop ];
  };
}