2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
blis,
|
|
|
|
buildPythonPackage,
|
|
|
|
callPackage,
|
|
|
|
catalogue,
|
|
|
|
cymem,
|
|
|
|
cython_0,
|
|
|
|
fetchPypi,
|
|
|
|
hypothesis,
|
|
|
|
jinja2,
|
|
|
|
jsonschema,
|
|
|
|
langcodes,
|
|
|
|
mock,
|
|
|
|
murmurhash,
|
|
|
|
numpy,
|
|
|
|
packaging,
|
|
|
|
pathy,
|
|
|
|
preshed,
|
|
|
|
pydantic,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
requests,
|
|
|
|
setuptools,
|
|
|
|
spacy-legacy,
|
|
|
|
spacy-loggers,
|
|
|
|
srsly,
|
|
|
|
thinc,
|
|
|
|
tqdm,
|
|
|
|
typer,
|
|
|
|
typing-extensions,
|
|
|
|
wasabi,
|
|
|
|
weasel,
|
|
|
|
writeScript,
|
|
|
|
nix,
|
|
|
|
git,
|
|
|
|
nix-update,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "spacy";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "3.7.5";
|
2023-11-16 04:20:00 +00:00
|
|
|
pyproject = true;
|
2021-10-06 13:57:05 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-pkjGy/Ksx6Vaae6ef6TyK99pqoKKWHobxc//CM88LdM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
pythonRelaxDeps = [
|
2024-04-21 15:54:59 +00:00
|
|
|
"smart-open"
|
2023-07-15 17:15:38 +00:00
|
|
|
"typer"
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2024-05-15 15:35:15 +00:00
|
|
|
cython_0
|
2023-07-15 17:15:38 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
2020-12-25 13:55:36 +00:00
|
|
|
blis
|
|
|
|
catalogue
|
|
|
|
cymem
|
2021-05-20 23:08:51 +00:00
|
|
|
jinja2
|
2020-12-25 13:55:36 +00:00
|
|
|
jsonschema
|
2022-04-27 09:35:20 +00:00
|
|
|
langcodes
|
2020-12-25 13:55:36 +00:00
|
|
|
murmurhash
|
|
|
|
numpy
|
2021-10-06 13:57:05 +00:00
|
|
|
packaging
|
|
|
|
pathy
|
2020-12-25 13:55:36 +00:00
|
|
|
preshed
|
2021-10-06 13:57:05 +00:00
|
|
|
pydantic
|
2020-12-25 13:55:36 +00:00
|
|
|
requests
|
|
|
|
setuptools
|
2021-05-20 23:08:51 +00:00
|
|
|
spacy-legacy
|
2022-04-27 09:35:20 +00:00
|
|
|
spacy-loggers
|
|
|
|
srsly
|
2020-12-25 13:55:36 +00:00
|
|
|
thinc
|
2021-10-06 13:57:05 +00:00
|
|
|
tqdm
|
2021-05-20 23:08:51 +00:00
|
|
|
typer
|
2021-10-06 13:57:05 +00:00
|
|
|
wasabi
|
2023-11-16 04:20:00 +00:00
|
|
|
weasel
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ];
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2024-04-21 15:54:59 +00:00
|
|
|
pytestCheckHook
|
|
|
|
hypothesis
|
|
|
|
mock
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
doCheck = true;
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
# Fixes ModuleNotFoundError when running tests on Cythonized code. See #255262
|
|
|
|
preCheck = ''
|
|
|
|
cd $out
|
2020-05-29 06:06:01 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestFlagsArray = [ "-m 'slow'" ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# touches network
|
|
|
|
"test_download_compatibility"
|
|
|
|
"test_validate_compatibility_table"
|
|
|
|
"test_project_assets"
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "spacy" ];
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = writeScript "update-spacy" ''
|
2024-04-21 15:54:59 +00:00
|
|
|
#!${stdenv.shell}
|
|
|
|
set -eou pipefail
|
2024-06-05 15:53:02 +00:00
|
|
|
PATH=${
|
|
|
|
lib.makeBinPath [
|
|
|
|
nix
|
|
|
|
git
|
|
|
|
nix-update
|
|
|
|
]
|
|
|
|
}
|
2023-02-22 10:55:15 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nix-update python3Packages.spacy
|
2023-02-22 10:55:15 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
# update spacy models as well
|
2024-05-15 15:35:15 +00:00
|
|
|
echo | nix-shell maintainers/scripts/update.nix --argstr package python3Packages.spacy-models.en_core_web_sm
|
2023-02-22 10:55:15 +00:00
|
|
|
'';
|
|
|
|
tests.annotation = callPackage ./annotation-test { };
|
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2022-04-27 09:35:20 +00:00
|
|
|
description = "Industrial-strength Natural Language Processing (NLP)";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "spacy";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/explosion/spaCy";
|
2023-03-15 16:39:30 +00:00
|
|
|
changelog = "https://github.com/explosion/spaCy/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2020-06-18 07:06:33 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|