2021-12-26 17:43:05 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2022-11-02 22:02:43 +00:00
|
|
|
, Accelerate
|
2020-04-24 23:36:52 +00:00
|
|
|
, blis
|
2022-11-02 22:02:43 +00:00
|
|
|
, buildPythonPackage
|
2020-04-24 23:36:52 +00:00
|
|
|
, catalogue
|
2022-11-02 22:02:43 +00:00
|
|
|
, confection
|
2021-10-06 13:57:05 +00:00
|
|
|
, CoreFoundation
|
|
|
|
, CoreGraphics
|
|
|
|
, CoreVideo
|
2022-11-02 22:02:43 +00:00
|
|
|
, cymem
|
|
|
|
, cython
|
|
|
|
, fetchPypi
|
2020-04-24 23:36:52 +00:00
|
|
|
, hypothesis
|
|
|
|
, mock
|
|
|
|
, murmurhash
|
|
|
|
, numpy
|
|
|
|
, plac
|
|
|
|
, preshed
|
2021-04-26 19:14:03 +00:00
|
|
|
, pydantic
|
2022-11-02 22:02:43 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, python
|
|
|
|
, pythonOlder
|
2023-11-16 04:20:00 +00:00
|
|
|
, setuptools
|
2020-04-24 23:36:52 +00:00
|
|
|
, srsly
|
|
|
|
, tqdm
|
2021-10-06 13:57:05 +00:00
|
|
|
, typing-extensions
|
2020-04-24 23:36:52 +00:00
|
|
|
, wasabi
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "thinc";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "8.2.2";
|
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-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-boW5RGcsD5UkGnH2f5iC4asxnESaR3QLDRWfTPhtFYc=";
|
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"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
buildInputs = [
|
|
|
|
cython
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2020-12-25 13:55:36 +00:00
|
|
|
Accelerate
|
|
|
|
CoreFoundation
|
|
|
|
CoreGraphics
|
|
|
|
CoreVideo
|
2021-10-06 13:57:05 +00:00
|
|
|
];
|
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
|
2022-10-30 15:09:59 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
2021-12-26 17:43:05 +00:00
|
|
|
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
|
|
|
|
2021-12-26 17:43:05 +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
|
|
|
}
|