summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/finalfusion/default.nix
blob: f39e7e7970a53a4d9c18fcae91e3a1e6b42bd476 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
  buildPythonPackage,
  fetchFromGitHub,
  lib,
  isPy3k,
  cython,
  numpy,
  toml,
  pytest,
}:

buildPythonPackage rec {
  pname = "finalfusion";
  version = "0.7.1";
  format = "setuptools";

  disabled = !isPy3k;

  src = fetchFromGitHub {
    owner = "finalfusion";
    repo = "finalfusion-python";
    rev = version;
    sha256 = "0pwzflamxqvpl1wcz0zbhhd6aa4xn18rmza6rggaic3ckidhyrh4";
  };

  nativeBuildInputs = [ cython ];

  propagatedBuildInputs = [
    numpy
    toml
  ];

  nativeCheckInputs = [ pytest ];

  postPatch = ''
    patchShebangs tests/integration

    # `np.float` was a deprecated alias of the builtin `float`
    substituteInPlace tests/test_storage.py \
      --replace 'dtype=np.float)' 'dtype=float)'
  '';

  checkPhase = ''
    # Regular unit tests.
    pytest

    # Integration tests for command-line utilities.
    PATH=$PATH:$out/bin tests/integration/all.sh
  '';

  meta = {
    description = "Python module for using finalfusion, word2vec, and fastText word embeddings";
    homepage = "https://github.com/finalfusion/finalfusion-python/";
    maintainers = [ ];
    platforms = lib.platforms.all;
    license = lib.licenses.blueOak100;
  };
}