2021-12-26 17:43:05 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2022-02-10 20:34:41 +00:00
|
|
|
, python
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchPypi
|
2021-10-06 13:57:05 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, blis
|
|
|
|
, catalogue
|
|
|
|
, cymem
|
|
|
|
, cython
|
2021-12-26 17:43:05 +00:00
|
|
|
, contextvars
|
|
|
|
, dataclasses
|
2021-10-06 13:57:05 +00:00
|
|
|
, Accelerate
|
|
|
|
, CoreFoundation
|
|
|
|
, CoreGraphics
|
|
|
|
, CoreVideo
|
2020-04-24 23:36:52 +00:00
|
|
|
, hypothesis
|
|
|
|
, mock
|
|
|
|
, murmurhash
|
|
|
|
, numpy
|
|
|
|
, plac
|
2021-10-06 13:57:05 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
, preshed
|
2021-04-26 19:14:03 +00:00
|
|
|
, pydantic
|
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";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "8.1.0";
|
2021-12-26 17:43:05 +00:00
|
|
|
format = "setuptools";
|
2021-10-06 13:57:05 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-6q6pHcVsBBUWqCnEYEI6iu9TVwAWEMjWOVvOldglSgs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace "pydantic>=1.7.4,!=1.8,!=1.8.1,<1.9.0" "pydantic"
|
|
|
|
'';
|
|
|
|
|
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
|
|
|
|
cymem
|
|
|
|
murmurhash
|
|
|
|
numpy
|
|
|
|
plac
|
|
|
|
preshed
|
|
|
|
srsly
|
|
|
|
tqdm
|
2021-04-26 19:14:03 +00:00
|
|
|
pydantic
|
2020-12-25 13:55:36 +00:00
|
|
|
wasabi
|
2021-12-26 17:43:05 +00:00
|
|
|
] ++ lib.optional (pythonOlder "3.8") [
|
|
|
|
typing-extensions
|
|
|
|
] ++ lib.optional (pythonOlder "3.7") [
|
|
|
|
contextvars
|
|
|
|
dataclasses
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
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; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Practical Machine Learning for NLP in Python";
|
|
|
|
homepage = "https://github.com/explosion/thinc";
|
|
|
|
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
|
|
|
}
|