1{ stdenv
2, lib
3, buildPythonPackage
4, fetchPypi
5, pythonOlder
6, pytest
7, cython
8, cymem
9, msgpack-numpy
10, msgpack-python
11, preshed
12, numpy
13, murmurhash
14, pathlib
15, hypothesis
16, tqdm
17, cytoolz
18, plac
19, six
20, mock
21, termcolor
22, wrapt
23, dill
24}:
25
26buildPythonPackage rec {
27 pname = "thinc";
28 version = "6.11.2";
29
30 src = fetchPypi {
31 inherit pname version;
32 sha256 = "028a014192e1914c151222794781d14e1c9fddf47a859aa36077f07871d0c30a";
33 };
34
35 postPatch = ''
36 substituteInPlace setup.py \
37 --replace "msgpack-python==" "msgpack-python>=" \
38 --replace "msgpack-numpy==" "msgpack-numpy>="
39 '';
40
41 propagatedBuildInputs = [
42 cython
43 cymem
44 msgpack-numpy
45 msgpack-python
46 preshed
47 numpy
48 murmurhash
49 pytest
50 hypothesis
51 tqdm
52 cytoolz
53 plac
54 six
55 mock
56 termcolor
57 wrapt
58 dill
59 ] ++ lib.optional (pythonOlder "3.4") pathlib;
60
61
62 checkInputs = [
63 pytest
64 ];
65
66 prePatch = ''
67 substituteInPlace setup.py --replace \
68 "'pathlib>=1.0.0,<2.0.0'," \
69 "\"pathlib>=1.0.0,<2.0.0; python_version<'3.4'\","
70
71 substituteInPlace setup.py --replace \
72 "'cytoolz>=0.8,<0.9'," \
73 "'cytoolz>=0.8',"
74 '';
75
76 # Cannot find cython modules.
77 doCheck = false;
78
79 checkPhase = ''
80 pytest thinc/tests
81 '';
82
83 meta = with stdenv.lib; {
84 description = "Practical Machine Learning for NLP in Python";
85 homepage = https://github.com/explosion/thinc;
86 license = licenses.mit;
87 maintainers = with maintainers; [ aborsu sdll ];
88 };
89}