2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
Accelerate,
|
|
|
|
blis,
|
|
|
|
buildPythonPackage,
|
|
|
|
catalogue,
|
|
|
|
confection,
|
|
|
|
CoreFoundation,
|
|
|
|
CoreGraphics,
|
|
|
|
CoreVideo,
|
|
|
|
cymem,
|
|
|
|
cython_0,
|
|
|
|
fetchPypi,
|
|
|
|
hypothesis,
|
|
|
|
mock,
|
|
|
|
murmurhash,
|
|
|
|
numpy,
|
|
|
|
plac,
|
|
|
|
preshed,
|
|
|
|
pydantic,
|
|
|
|
pytestCheckHook,
|
|
|
|
python,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
|
|
|
srsly,
|
|
|
|
tqdm,
|
|
|
|
typing-extensions,
|
|
|
|
wasabi,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "thinc";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "8.2.3";
|
2021-12-26 17:43:05 +00:00
|
|
|
format = "setuptools";
|
2021-10-06 13:57:05 +00:00
|
|
|
|
2022-12-17 10:02:37 +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-9a/FIikSqAvai9zslYNiorpTjXAn3I22FUhF0oWdynY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace "preshed>=3.0.2,<3.1.0" "preshed"
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs =
|
|
|
|
[ cython_0 ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [
|
|
|
|
Accelerate
|
|
|
|
CoreFoundation
|
|
|
|
CoreGraphics
|
|
|
|
CoreVideo
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2020-12-25 13:55:36 +00:00
|
|
|
blis
|
|
|
|
catalogue
|
2022-11-02 22:02:43 +00:00
|
|
|
confection
|
2020-12-25 13:55:36 +00:00
|
|
|
cymem
|
|
|
|
murmurhash
|
|
|
|
numpy
|
|
|
|
plac
|
|
|
|
preshed
|
2022-11-02 22:02:43 +00:00
|
|
|
pydantic
|
2020-12-25 13:55:36 +00:00
|
|
|
srsly
|
|
|
|
tqdm
|
|
|
|
wasabi
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2020-04-24 23:36:52 +00:00
|
|
|
hypothesis
|
|
|
|
mock
|
2021-10-06 13:57:05 +00:00
|
|
|
pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
# Add native extensions.
|
|
|
|
preCheck = ''
|
|
|
|
export PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
# avoid local paths, relative imports wont resolve correctly
|
|
|
|
mv thinc/tests tests
|
|
|
|
rm -r thinc
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "thinc" ];
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-11-02 22:02:43 +00:00
|
|
|
description = "Library for NLP machine learning";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/explosion/thinc";
|
2023-11-16 04:20:00 +00:00
|
|
|
changelog = "https://github.com/explosion/thinc/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; [ aborsu ];
|
2020-12-25 13:55:36 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|