python312Packages.thinc: fix build; modernize; remove old darwin crust

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
This commit is contained in:
Ihar Hrachyshka
2025-04-09 16:40:48 -04:00
parent 6c98e107c7
commit 4a65cee267
2 changed files with 9 additions and 33 deletions
@@ -1,14 +1,10 @@
{
lib,
stdenv,
Accelerate,
blas,
blis,
buildPythonPackage,
catalogue,
confection,
CoreFoundation,
CoreGraphics,
CoreVideo,
cymem,
cython_0,
fetchPypi,
@@ -19,10 +15,8 @@
preshed,
pydantic,
pytestCheckHook,
pythonOlder,
setuptools,
srsly,
typing-extensions,
wasabi,
}:
@@ -31,22 +25,14 @@ buildPythonPackage rec {
version = "9.1.1";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-IfrimG13d6bwULkEbcnqsRhS8cmpl9zJAy8+zCJ4Sko=";
};
postPatch = ''
# As per https://github.com/explosion/thinc/releases/tag/release-v8.3.0 no
# code changes were required for NumPy 2.0. Thus Thinc should be compatible
# with NumPy 1.0 and 2.0.
substituteInPlace pyproject.toml setup.cfg \
--replace-fail "blis>=1.0.0,<1.1.0" blis \
--replace-fail "numpy>=2.0.0,<2.1.0" numpy
substituteInPlace setup.cfg \
--replace-fail "numpy>=2.0.1,<2.1.0" numpy
--replace-fail "blis>=1.0.0,<1.1.0" blis
'';
build-system = [
@@ -59,11 +45,8 @@ buildPythonPackage rec {
setuptools
];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
Accelerate
CoreFoundation
CoreGraphics
CoreVideo
buildInputs = [
blas
];
dependencies = [
@@ -77,7 +60,7 @@ buildPythonPackage rec {
pydantic
srsly
wasabi
] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ];
];
nativeCheckInputs = [
hypothesis
@@ -93,11 +76,11 @@ buildPythonPackage rec {
pythonImportsCheck = [ "thinc" ];
meta = with lib; {
meta = {
description = "Library for NLP machine learning";
homepage = "https://github.com/explosion/thinc";
changelog = "https://github.com/explosion/thinc/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ aborsu ];
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ aborsu ];
};
}
+1 -8
View File
@@ -17139,14 +17139,7 @@ self: super: with self; {
thespian = callPackage ../development/python-modules/thespian { };
thinc = callPackage ../development/python-modules/thinc {
inherit (pkgs.darwin.apple_sdk.frameworks)
Accelerate
CoreFoundation
CoreGraphics
CoreVideo
;
};
thinc = callPackage ../development/python-modules/thinc { };
thinqconnect = callPackage ../development/python-modules/thinqconnect { };