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