python3Packages.word2vec: fix build and tests
This commit is contained in:
parent
5f0f2b85cb
commit
6a4e785931
|
@ -1,14 +1,23 @@
|
||||||
{ stdenv
|
{ stdenv
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
, fetchPypi
|
, fetchPypi
|
||||||
|
, fetchzip
|
||||||
, cython
|
, cython
|
||||||
, numpy
|
, numpy
|
||||||
, scikitlearn
|
, scikitlearn
|
||||||
, six
|
, six
|
||||||
, python
|
, setuptools_scm
|
||||||
|
, gcc
|
||||||
|
, pytest
|
||||||
|
, pytestcov
|
||||||
, isPy27
|
, isPy27
|
||||||
}:
|
}:
|
||||||
|
let
|
||||||
|
testData = fetchzip {
|
||||||
|
url = "http://mattmahoney.net/dc/text8.zip";
|
||||||
|
sha256 = "0w3l64bww9znmmvd9cqbfmh3dddnlrjicz43y5qq6fhi9cfqjfar";
|
||||||
|
};
|
||||||
|
in
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "word2vec";
|
pname = "word2vec";
|
||||||
version = "0.11.1";
|
version = "0.11.1";
|
||||||
|
@ -19,17 +28,25 @@ buildPythonPackage rec {
|
||||||
sha256 = "222d8ffb47f385c43eba45e3f308e605fc9736b2b7137d74979adf1a31e7c8b4";
|
sha256 = "222d8ffb47f385c43eba45e3f308e605fc9736b2b7137d74979adf1a31e7c8b4";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [ setuptools_scm gcc ];
|
||||||
|
|
||||||
propagatedBuildInputs = [ cython numpy scikitlearn six ];
|
propagatedBuildInputs = [ cython numpy scikitlearn six ];
|
||||||
|
|
||||||
|
checkInputs = [ pytest pytestcov ];
|
||||||
|
|
||||||
|
# Checks require test data downloaded separately
|
||||||
|
# See project source Makefile:test-data rule for reference
|
||||||
checkPhase = ''
|
checkPhase = ''
|
||||||
cd word2vec/tests;
|
PATH=$PATH:$out/bin
|
||||||
${python.interpreter} test_word2vec.py
|
mkdir data
|
||||||
|
head -c 100000 ${testData}/text8 > data/text8-small
|
||||||
|
pytest
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Tool for computing continuous distributed representations of words";
|
description = "Tool for computing continuous distributed representations of words";
|
||||||
homepage = "https://github.com/danielfrg/word2vec";
|
homepage = "https://github.com/danielfrg/word2vec";
|
||||||
license = licenses.asl20;
|
license = licenses.asl20;
|
||||||
maintainers = with maintainers; [ NikolaMandic ];
|
maintainers = with maintainers; [ NikolaMandic ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue