@@ -1,15 +1,19 @@
11{ stdenv
2+, lib
23, pkgs
34, buildPythonPackage
45, fetchPypi
5−, fetchFromGitHub
6+, pythonOlder
67, pytest
78, cython
89, cymem
10+, msgpack-numpy
11+, msgpack-python
912, preshed
1013, numpy
1114, python
1215, murmurhash
16+, pathlib
1317, hypothesis
1418, tqdm
1519, cytoolz
@@ -21,36 +25,21 @@
2125, dill
2226}:
2327
24−let
25− enableDebugging = true;
26−
27− pathlibLocked = buildPythonPackage rec {
28− name = "${pname}-${version}";
29− pname = "pathlib";
30− version = "1.0.1";
31−
32− src = fetchPypi {
33− inherit pname version;
34− sha256 = "17zajiw4mjbkkv6ahp3xf025qglkj0805m9s41c45zryzj6p2h39";
35− };
36−
37− doCheck = false; # fails to import support from test
38− };
39−in buildPythonPackage rec {
28+buildPythonPackage rec {
4029 pname = "thinc";
41− version = "6.5.1";
30+ version = "6.10.2";
4231 name = pname + "-" + version;
4332
44− src = fetchFromGitHub {
45− owner = "explosion";
46− repo = "thinc";
47− rev = "v${version}";
48− sha256 = "008kmjsvanh6qgnpvsn3qacfcyprxirxbw4yfd8flyg7mxw793ws";
33+ src = fetchPypi {
34+ inherit pname version;
35+ sha256 = "0xia81wvfrhyriywab184s49g8rpl42vcf5fy3x6xxw50a2yn7cs";
4936 };
5037
5138 propagatedBuildInputs = [
5239 cython
5340 cymem
41+ msgpack-numpy
42+ msgpack-python
5443 preshed
5544 numpy
5645 murmurhash
@@ -64,22 +53,34 @@ in buildPythonPackage rec {
6453 termcolor
6554 wrapt
6655 dill
67− pathlibLocked
56+ ] ++ lib.optional (pythonOlder "3.4") pathlib;
57+
58+
59+ checkInputs = [
60+ pytest
6861 ];
6962
63+ prePatch = ''
64+ substituteInPlace setup.py --replace \
65+ "'pathlib>=1.0.0,<2.0.0'," \
66+ "\"pathlib>=1.0.0,<2.0.0; python_version<'3.4'\","
67+
68+ substituteInPlace setup.py --replace \
69+ "'cytoolz>=0.8,<0.9'," \
70+ "'cytoolz>=0.8',"
71+ '';
72+
73+ # Cannot find cython modules.
7074 doCheck = false;
7175
72− # fails to import some modules
73− # checkPhase = ''
74− # ${python.interpreter} -m pytest thinc/tests
75− # # cd thinc/tests
76− # # ${python.interpreter} -m unittest discover -p "*test*"
77− # '';
76+ checkPhase = ''
77+ pytest thinc/tests
78+ '';
7879
7980 meta = with stdenv.lib; {
8081 description = "Practical Machine Learning for NLP in Python";
8182 homepage = https://github.com/explosion/thinc;
8283 license = licenses.mit;
83− maintainers = with maintainers; [ sdll ];
84+ maintainers = with maintainers; [ aborsu sdll ];
8485 };
8586}