1{ lib
2, stdenv
3, Accelerate
4, blis
5, buildPythonPackage
6, catalogue
7, confection
8, CoreFoundation
9, CoreGraphics
10, CoreVideo
11, cymem
12, cython
13, fetchPypi
14, hypothesis
15, mock
16, murmurhash
17, numpy
18, plac
19, preshed
20, pydantic
21, pytestCheckHook
22, python
23, pythonOlder
24, srsly
25, tqdm
26, typing-extensions
27, wasabi
28}:
29
30buildPythonPackage rec {
31 pname = "thinc";
32 version = "8.1.10";
33 format = "setuptools";
34
35 disabled = pythonOlder "3.7";
36
37 src = fetchPypi {
38 inherit pname version;
39 hash = "sha256-bEpI19oH4EToSmjLubIvMvhJCZWiurC/xg5BLRSvuZE=";
40 };
41
42 buildInputs = [
43 cython
44 ] ++ lib.optionals stdenv.isDarwin [
45 Accelerate
46 CoreFoundation
47 CoreGraphics
48 CoreVideo
49 ];
50
51 propagatedBuildInputs = [
52 blis
53 catalogue
54 confection
55 cymem
56 murmurhash
57 numpy
58 plac
59 preshed
60 pydantic
61 srsly
62 tqdm
63 wasabi
64 ] ++ lib.optionals (pythonOlder "3.8") [
65 typing-extensions
66 ];
67
68 nativeCheckInputs = [
69 hypothesis
70 mock
71 pytestCheckHook
72 ];
73
74 # Add native extensions.
75 preCheck = ''
76 export PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH
77
78 # avoid local paths, relative imports wont resolve correctly
79 mv thinc/tests tests
80 rm -r thinc
81 '';
82
83 pythonImportsCheck = [
84 "thinc"
85 ];
86
87 meta = with lib; {
88 description = "Library for NLP machine learning";
89 homepage = "https://github.com/explosion/thinc";
90 license = licenses.mit;
91 maintainers = with maintainers; [ aborsu ];
92 };
93}