Skip to content

Commit

Permalink
python312Packages.thinc: 8.2.3 -> 8.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dotlambda committed Sep 2, 2024
1 parent 8719eb4 commit 1f03dd2
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions pkgs/development/python-modules/thinc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,59 +16,66 @@
mock,
murmurhash,
numpy,
plac,
preshed,
pydantic,
pytestCheckHook,
python,
pythonOlder,
setuptools,
srsly,
tqdm,
typing-extensions,
wasabi,
}:

buildPythonPackage rec {
pname = "thinc";
version = "8.2.3";
format = "setuptools";
version = "8.3.0";
pyproject = true;

disabled = pythonOlder "3.7";

src = fetchPypi {
inherit pname version;
hash = "sha256-9a/FIikSqAvai9zslYNiorpTjXAn3I22FUhF0oWdynY=";
hash = "sha256-6zvtVPXADsmt2qogjFHM+gWUg9cxQM1RWqMzc3Fcblk=";
};

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 "numpy>=2.0.0,<2.1.0" numpy
substituteInPlace setup.cfg \
--replace "preshed>=3.0.2,<3.1.0" "preshed"
--replace-fail "numpy>=2.0.1,<2.1.0" numpy
'';

nativeBuildInputs = [ setuptools ];
build-system = [
blis
cymem
cython_0
murmurhash
numpy
preshed
setuptools
];

buildInputs =
[ cython_0 ]
++ lib.optionals stdenv.isDarwin [
Accelerate
CoreFoundation
CoreGraphics
CoreVideo
];
buildInputs = lib.optionals stdenv.isDarwin [
Accelerate
CoreFoundation
CoreGraphics
CoreVideo
];

propagatedBuildInputs = [
dependencies = [
blis
catalogue
confection
cymem
murmurhash
numpy
plac
preshed
pydantic
srsly
tqdm
wasabi
] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ];

Expand All @@ -78,10 +85,7 @@ buildPythonPackage rec {
pytestCheckHook
];

# Add native extensions.
preCheck = ''
export PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH
# avoid local paths, relative imports wont resolve correctly
mv thinc/tests tests
rm -r thinc
Expand Down

0 comments on commit 1f03dd2

Please sign in to comment.