+40
-33
pkgs/development/python-modules/spacy/default.nix
+40
-33
pkgs/development/python-modules/spacy/default.nix
···
2
2
lib,
3
3
stdenv,
4
4
buildPythonPackage,
5
-
callPackage,
6
-
catalogue,
5
+
fetchFromGitHub,
6
+
7
+
# build-system
7
8
cymem,
8
9
cython_0,
9
-
fetchPypi,
10
-
git,
11
-
hypothesis,
10
+
murmurhash,
11
+
numpy,
12
+
preshed,
13
+
thinc,
14
+
15
+
# dependencies
16
+
catalogue,
12
17
jinja2,
13
18
langcodes,
14
-
mock,
15
-
murmurhash,
16
-
nix-update,
17
-
nix,
18
-
numpy,
19
19
packaging,
20
-
preshed,
21
20
pydantic,
22
-
pytestCheckHook,
23
-
pythonOlder,
24
21
requests,
25
22
setuptools,
26
23
spacy-legacy,
27
24
spacy-loggers,
28
-
spacy-lookups-data,
29
-
spacy-transformers,
30
25
srsly,
31
-
thinc,
32
26
tqdm,
33
27
typer,
34
28
wasabi,
35
29
weasel,
30
+
31
+
# optional-dependencies
32
+
spacy-transformers,
33
+
spacy-lookups-data,
34
+
35
+
# tests
36
+
pytestCheckHook,
37
+
hypothesis,
38
+
mock,
39
+
40
+
# passthru
36
41
writeScript,
42
+
git,
43
+
nix,
44
+
nix-update,
45
+
callPackage,
37
46
}:
38
47
39
48
buildPythonPackage rec {
···
41
50
version = "3.8.5";
42
51
pyproject = true;
43
52
44
-
src = fetchPypi {
45
-
inherit pname version;
46
-
hash = "sha256-OLyLh3+yT0FJBf8XliADFgfNMf5vkA1noGcwFCcVZRw=";
53
+
src = fetchFromGitHub {
54
+
owner = "explosion";
55
+
repo = "spaCy";
56
+
tag = "release-v${version}";
57
+
hash = "sha256-rgMstGSscUBACA5+veXD9H/lHuvWKs7hJ6hz6aKOB/0=";
47
58
};
48
-
49
-
postPatch = ''
50
-
# unpin numpy, cannot use pythonRelaxDeps because it's in build-system
51
-
substituteInPlace pyproject.toml setup.cfg \
52
-
--replace-fail ",<2.1.0" ""
53
-
'';
54
59
55
60
build-system = [
56
61
cymem
···
85
90
weasel
86
91
];
87
92
93
+
optional-dependencies = {
94
+
transformers = [ spacy-transformers ];
95
+
lookups = [ spacy-lookups-data ];
96
+
};
97
+
88
98
nativeCheckInputs = [
89
99
pytestCheckHook
90
100
hypothesis
91
101
mock
92
102
];
93
103
94
-
optional-dependencies = {
95
-
transformers = [ spacy-transformers ];
96
-
lookups = [ spacy-lookups-data ];
97
-
};
98
-
99
104
# Fixes ModuleNotFoundError when running tests on Cythonized code. See #255262
100
105
preCheck = ''
101
106
cd $out
···
118
123
set -eou pipefail
119
124
PATH=${
120
125
lib.makeBinPath [
121
-
nix
122
126
git
127
+
nix
123
128
nix-update
124
129
]
125
130
}
···
132
137
tests.annotation = callPackage ./annotation-test { };
133
138
};
134
139
135
-
meta = with lib; {
140
+
meta = {
136
141
description = "Industrial-strength Natural Language Processing (NLP)";
137
142
homepage = "https://github.com/explosion/spaCy";
138
143
changelog = "https://github.com/explosion/spaCy/releases/tag/release-v${version}";
139
-
license = licenses.mit;
144
+
license = lib.licenses.mit;
140
145
maintainers = [ ];
141
146
mainProgram = "spacy";
147
+
# Cython.Compiler.Errors.CompileError: spacy/ml/parser_model.pyx
148
+
broken = true;
142
149
};
143
150
}