1{ lib
2, buildPythonPackage
3, callPackage
4, fetchPypi
5, pythonOlder
6, pytest
7, blis
8, catalogue
9, cymem
10, jinja2
11, jsonschema
12, murmurhash
13, numpy
14, pathlib
15, preshed
16, requests
17, setuptools
18, srsly
19, spacy-legacy
20, thinc
21, typer
22, wasabi
23, packaging
24, pathy
25, pydantic
26}:
27
28buildPythonPackage rec {
29 pname = "spacy";
30 version = "3.0.6";
31
32 src = fetchPypi {
33 inherit pname version;
34 hash = "sha256-ViirifH1aAmciAsSqcN/Ts4pq4kmBmDP33KMAnEYecU=";
35 };
36
37 propagatedBuildInputs = [
38 blis
39 catalogue
40 cymem
41 jinja2
42 jsonschema
43 murmurhash
44 numpy
45 preshed
46 requests
47 setuptools
48 srsly
49 spacy-legacy
50 thinc
51 wasabi
52 packaging
53 pathy
54 pydantic
55 typer
56 ] ++ lib.optional (pythonOlder "3.4") pathlib;
57
58 checkInputs = [
59 pytest
60 ];
61
62 doCheck = false;
63 # checkPhase = ''
64 # ${python.interpreter} -m pytest spacy/tests --vectors --models --slow
65 # '';
66
67 postPatch = ''
68 substituteInPlace setup.cfg \
69 --replace "blis>=0.4.0,<0.8.0" "blis>=0.4.0,<1.0" \
70 --replace "pydantic>=1.7.1,<1.8.0" "pydantic>=1.7.1,<1.8.3"
71 '';
72
73 pythonImportsCheck = [ "spacy" ];
74
75 passthru.tests.annotation = callPackage ./annotation-test { };
76
77 meta = with lib; {
78 description = "Industrial-strength Natural Language Processing (NLP) with Python and Cython";
79 homepage = "https://github.com/explosion/spaCy";
80 license = licenses.mit;
81 maintainers = with maintainers; [ sdll ];
82 };
83}