1{ buildPythonPackage
2, fetchFromGitHub
3, lib
4, isPy3k
5, cython
6, numpy
7, toml
8, pytest
9}:
10
11buildPythonPackage rec {
12 pname = "finalfusion";
13 version = "0.7.1";
14
15 disabled = !isPy3k;
16
17 src = fetchFromGitHub {
18 owner = "finalfusion";
19 repo = "finalfusion-python";
20 rev = version;
21 sha256 = "0pwzflamxqvpl1wcz0zbhhd6aa4xn18rmza6rggaic3ckidhyrh4";
22 };
23
24 nativeBuildInputs = [
25 cython
26 ];
27
28 propagatedBuildInputs = [
29 numpy
30 toml
31 ];
32
33 nativeCheckInputs = [
34 pytest
35 ];
36
37 postPatch = ''
38 patchShebangs tests/integration
39
40 # `np.float` was a deprecated alias of the builtin `float`
41 substituteInPlace tests/test_storage.py \
42 --replace 'dtype=np.float)' 'dtype=float)'
43 '';
44
45 checkPhase = ''
46 # Regular unit tests.
47 pytest
48
49 # Integration tests for command-line utilities.
50 PATH=$PATH:$out/bin tests/integration/all.sh
51 '';
52
53 meta = with lib; {
54 description = "Python module for using finalfusion, word2vec, and fastText word embeddings";
55 homepage = "https://github.com/finalfusion/finalfusion-python/";
56 maintainers = with maintainers; [ ];
57 platforms = platforms.all;
58 license = licenses.blueOak100;
59 };
60}