File tree 1 file changed +22
-5
lines changed
pkgs/development/python-modules/word2vec
1 file changed +22
-5
lines changed Original file line number Diff line number Diff line change 1
1
{ stdenv
2
2
, buildPythonPackage
3
3
, fetchPypi
4
+ , fetchzip
4
5
, cython
5
6
, numpy
6
7
, scikitlearn
7
8
, six
8
- , python
9
+ , setuptools_scm
10
+ , gcc
11
+ , pytest
12
+ , pytestcov
9
13
, isPy27
10
14
} :
11
-
15
+ let
16
+ testData = fetchzip {
17
+ url = "http://mattmahoney.net/dc/text8.zip" ;
18
+ sha256 = "0w3l64bww9znmmvd9cqbfmh3dddnlrjicz43y5qq6fhi9cfqjfar" ;
19
+ } ;
20
+ in
12
21
buildPythonPackage rec {
13
22
pname = "word2vec" ;
14
23
version = "0.11.1" ;
@@ -19,17 +28,25 @@ buildPythonPackage rec {
19
28
sha256 = "222d8ffb47f385c43eba45e3f308e605fc9736b2b7137d74979adf1a31e7c8b4" ;
20
29
} ;
21
30
31
+ nativeBuildInputs = [ setuptools_scm gcc ] ;
32
+
22
33
propagatedBuildInputs = [ cython numpy scikitlearn six ] ;
23
34
35
+ checkInputs = [ pytest pytestcov ] ;
36
+
37
+ # Checks require test data downloaded separately
38
+ # See project source Makefile:test-data rule for reference
24
39
checkPhase = ''
25
- cd word2vec/tests;
26
- ${ python . interpreter } test_word2vec.py
40
+ PATH=$PATH:$out/bin
41
+ mkdir data
42
+ head -c 100000 ${ testData } /text8 > data/text8-small
43
+ pytest
27
44
'' ;
28
45
29
46
meta = with stdenv . lib ; {
30
47
description = "Tool for computing continuous distributed representations of words" ;
31
48
homepage = "https://github.com/danielfrg/word2vec" ;
32
- license = licenses . asl20 ;
49
+ license = licenses . asl20 ;
33
50
maintainers = with maintainers ; [ NikolaMandic ] ;
34
51
} ;
35
52
You can’t perform that action at this time.
0 commit comments