1{ lib
2, buildPythonPackage
3, fetchPypi
4, pythonOlder
5, html5lib
6, pytest
7, preshed
8, ftfy
9, numpy
10, murmurhash
11, plac
12, six
13, ujson
14, dill
15, requests
16, thinc
17, regex
18, cymem
19, pathlib
20, msgpack-python
21, msgpack-numpy
22}:
23
24buildPythonPackage rec {
25 pname = "spacy";
26 version = "2.0.12";
27
28 src = fetchPypi {
29 inherit pname version;
30 sha256 = "b220ebee412c19613c26b2c1870b60473834bd686cec49553ce5f184164d3359";
31 };
32
33 prePatch = ''
34 substituteInPlace setup.py \
35 --replace "html5lib==" "html5lib>=" \
36 --replace "regex==" "regex>=" \
37 --replace "ftfy==" "ftfy>=" \
38 --replace "msgpack-python==" "msgpack-python>=" \
39 --replace "msgpack-numpy==" "msgpack-numpy>=" \
40 --replace "pathlib" "pathlib; python_version<\"3.4\""
41 '';
42
43 propagatedBuildInputs = [
44 numpy
45 murmurhash
46 cymem
47 preshed
48 thinc
49 plac
50 six
51 html5lib
52 ujson
53 dill
54 requests
55 regex
56 ftfy
57 msgpack-python
58 msgpack-numpy
59 ] ++ lib.optional (pythonOlder "3.4") pathlib;
60
61 checkInputs = [
62 pytest
63 ];
64
65 doCheck = false;
66 # checkPhase = ''
67 # ${python.interpreter} -m pytest spacy/tests --vectors --models --slow
68 # '';
69
70 meta = with lib; {
71 description = "Industrial-strength Natural Language Processing (NLP) with Python and Cython";
72 homepage = https://github.com/explosion/spaCy;
73 license = licenses.mit;
74 maintainers = with maintainers; [ sdll ];
75 };
76}