2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2023-07-15 17:15:38 +00:00
|
|
|
, stdenv
|
2022-04-27 09:35:20 +00:00
|
|
|
, blis
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2020-08-20 17:08:02 +00:00
|
|
|
, callPackage
|
2020-04-24 23:36:52 +00:00
|
|
|
, catalogue
|
|
|
|
, cymem
|
2022-04-27 09:35:20 +00:00
|
|
|
, fetchPypi
|
2024-04-21 15:54:59 +00:00
|
|
|
, hypothesis
|
2021-05-20 23:08:51 +00:00
|
|
|
, jinja2
|
2020-04-24 23:36:52 +00:00
|
|
|
, jsonschema
|
2022-04-27 09:35:20 +00:00
|
|
|
, langcodes
|
2024-04-21 15:54:59 +00:00
|
|
|
, mock
|
2020-04-24 23:36:52 +00:00
|
|
|
, murmurhash
|
|
|
|
, numpy
|
2022-04-27 09:35:20 +00:00
|
|
|
, packaging
|
|
|
|
, pathy
|
2020-04-24 23:36:52 +00:00
|
|
|
, preshed
|
2022-04-27 09:35:20 +00:00
|
|
|
, pydantic
|
2024-04-21 15:54:59 +00:00
|
|
|
, pytestCheckHook
|
2022-04-27 09:35:20 +00:00
|
|
|
, python
|
|
|
|
, pythonOlder
|
2023-07-15 17:15:38 +00:00
|
|
|
, pythonRelaxDepsHook
|
2020-04-24 23:36:52 +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-04-24 23:36:52 +00:00
|
|
|
, thinc
|
2021-10-06 13:57:05 +00:00
|
|
|
, tqdm
|
2022-04-27 09:35:20 +00:00
|
|
|
, typer
|
2021-10-06 13:57:05 +00:00
|
|
|
, typing-extensions
|
2022-04-27 09:35:20 +00:00
|
|
|
, wasabi
|
2023-11-16 04:20:00 +00:00
|
|
|
, weasel
|
2023-02-22 10:55:15 +00:00
|
|
|
, writeScript
|
|
|
|
, nix
|
|
|
|
, git
|
|
|
|
, nix-update
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "spacy";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "3.7.4";
|
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-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-Ul8s7S5AdhViyMrOk+9qHm6MSD8nvVZLwbFfYI776Fs=";
|
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 = [
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
];
|
|
|
|
|
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
|
2022-10-30 15:09:59 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
2022-04-27 09:35:20 +00:00
|
|
|
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-04-21 15:54:59 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"-m 'slow'"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# touches network
|
|
|
|
"test_download_compatibility"
|
|
|
|
"test_validate_compatibility_table"
|
|
|
|
"test_project_assets"
|
|
|
|
];
|
|
|
|
|
2022-04-27 09:35:20 +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
|
|
|
|
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
|
|
|
|
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;
|
2021-09-22 15:38:15 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-06-18 07:06:33 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|