From 8719eb45524dc38d0324b730e87edb4cb45c44ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 8 Aug 2024 05:15:46 -0700 Subject: [PATCH 1/4] python312Packages.blis: 0.7.11 -> 1.0.0 Diff: https://github.com/explosion/cython-blis/compare/v0.7.11...release-v1.0.0 Changelog: https://github.com/explosion/cython-blis/releases/tag/release-v1.0.0 --- .../python-modules/blis/default.nix | 39 ++++++++++++------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/blis/default.nix b/pkgs/development/python-modules/blis/default.nix index f6075a7e5bc67..cda35bcb9370e 100644 --- a/pkgs/development/python-modules/blis/default.nix +++ b/pkgs/development/python-modules/blis/default.nix @@ -3,33 +3,41 @@ buildPythonPackage, fetchFromGitHub, setuptools, - cython_0, + cython, hypothesis, numpy, pytestCheckHook, pythonOlder, + blis, + numpy_2, gitUpdater, }: buildPythonPackage rec { pname = "blis"; - version = "0.7.11"; + version = "1.0.0"; pyproject = true; - disabled = pythonOlder "3.7"; + disabled = pythonOlder "3.9"; src = fetchFromGitHub { owner = "explosion"; repo = "cython-blis"; - rev = "refs/tags/v${version}"; - hash = "sha256-p8pzGZc5OiiGTvXULDgzsBC3jIhovTKUq3RtPnQ/+to="; + rev = "refs/tags/release-v${version}"; + hash = "sha256-XS6h2c+8BJ9pAvIX8340C4vRZEBRmEZc6/6tH7ooqNU="; }; postPatch = '' + # The commit pinning numpy to version 2 doesn't have any functional changes: + # https://github.com/explosion/cython-blis/pull/108 + # BLIS should thus work with numpy and numpy_2. + substituteInPlace pyproject.toml setup.py \ + --replace-fail "numpy>=2.0.0,<3.0.0" numpy + # See https://github.com/numpy/numpy/issues/21079 # has no functional difference as the name is only used in log output substituteInPlace blis/benchmark.py \ - --replace 'numpy.__config__.blas_ilp64_opt_info["libraries"]' '["dummy"]' + --replace-fail 'numpy.__config__.blas_ilp64_opt_info["libraries"]' '["dummy"]' ''; preCheck = '' @@ -37,12 +45,13 @@ buildPythonPackage rec { rm -rf ./blis ''; - nativeBuildInputs = [ + build-system = [ setuptools - cython_0 + cython + numpy ]; - propagatedBuildInputs = [ numpy ]; + dependencies = [ numpy ]; nativeCheckInputs = [ hypothesis @@ -52,16 +61,18 @@ buildPythonPackage rec { pythonImportsCheck = [ "blis" ]; passthru = { - # Do not update to BLIS 0.9.x until the following issue is resolved: - # https://github.com/explosion/thinc/issues/771#issuecomment-1255825935 - skipBulkUpdate = true; + tests = { + numpy_2 = blis.overridePythonAttrs (old: { + numpy = numpy_2; + }); + }; updateScript = gitUpdater { - rev-prefix = "v"; - ignoredVersions = "0\.9\..*"; + rev-prefix = "release-v"; }; }; meta = with lib; { + changelog = "https://github.com/explosion/cython-blis/releases/tag/release-v${version}"; description = "BLAS-like linear algebra library"; homepage = "https://github.com/explosion/cython-blis"; license = licenses.bsd3; From 1f03dd265f9277d7e21e01c8abba1ba0f4a907f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 1 Sep 2024 16:40:20 -0700 Subject: [PATCH 2/4] python312Packages.thinc: 8.2.3 -> 8.3.0 Changelog: https://github.com/explosion/thinc/releases/tag/v8.2.4 https://github.com/explosion/thinc/releases/tag/v8.2.5 https://github.com/explosion/thinc/releases/tag/v8.3.0 --- .../python-modules/thinc/default.nix | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/pkgs/development/python-modules/thinc/default.nix b/pkgs/development/python-modules/thinc/default.nix index 86700bd0aed20..b0754a32de763 100644 --- a/pkgs/development/python-modules/thinc/default.nix +++ b/pkgs/development/python-modules/thinc/default.nix @@ -16,7 +16,6 @@ mock, murmurhash, numpy, - plac, preshed, pydantic, pytestCheckHook, @@ -24,51 +23,59 @@ 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 ]; @@ -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 From 83c48b4d47f5d3486370bf6e5d6fe52f23146fed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 2 Sep 2024 13:03:54 -0700 Subject: [PATCH 3/4] python311Packages.spacy: unpin thinc --- pkgs/development/python-modules/spacy/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/python-modules/spacy/default.nix b/pkgs/development/python-modules/spacy/default.nix index 9842e22c92d94..5467d1da05b10 100644 --- a/pkgs/development/python-modules/spacy/default.nix +++ b/pkgs/development/python-modules/spacy/default.nix @@ -50,6 +50,13 @@ buildPythonPackage rec { hash = "sha256-pkjGy/Ksx6Vaae6ef6TyK99pqoKKWHobxc//CM88LdM="; }; + postPatch = '' + # thinc version 8.3.0 had no functional changes + # also see https://github.com/explosion/spaCy/issues/13607 + substituteInPlace pyproject.toml setup.cfg \ + --replace-fail "thinc>=8.2.2,<8.3.0" "thinc>=8.2.2,<8.4.0" + ''; + pythonRelaxDeps = [ "smart-open" "typer" From d3f0837c958c414a08f4198dd8ecd5a9677d905e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 2 Sep 2024 12:17:28 -0700 Subject: [PATCH 4/4] python311Packages.spacy: 3.7.5 -> 3.7.6 Changelog: https://github.com/explosion/spaCy/releases/tag/release-v3.7.6 --- .../python-modules/spacy/default.nix | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/pkgs/development/python-modules/spacy/default.nix b/pkgs/development/python-modules/spacy/default.nix index 5467d1da05b10..51d20b3f2498b 100644 --- a/pkgs/development/python-modules/spacy/default.nix +++ b/pkgs/development/python-modules/spacy/default.nix @@ -10,13 +10,11 @@ fetchPypi, hypothesis, jinja2, - jsonschema, langcodes, mock, murmurhash, numpy, packaging, - pathy, preshed, pydantic, pytestCheckHook, @@ -29,7 +27,6 @@ thinc, tqdm, typer, - typing-extensions, wasabi, weasel, writeScript, @@ -40,14 +37,14 @@ buildPythonPackage rec { pname = "spacy"; - version = "3.7.5"; + version = "3.7.6"; pyproject = true; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - hash = "sha256-pkjGy/Ksx6Vaae6ef6TyK99pqoKKWHobxc//CM88LdM="; + hash = "sha256-9AZcCqxcSLv7L/4ZHVXMszv7AFN2r71MzW1ek0FRTjQ="; }; postPatch = '' @@ -57,26 +54,22 @@ buildPythonPackage rec { --replace-fail "thinc>=8.2.2,<8.3.0" "thinc>=8.2.2,<8.4.0" ''; - pythonRelaxDeps = [ - "smart-open" - "typer" - ]; - - nativeBuildInputs = [ + build-system = [ + cymem cython_0 + murmurhash + numpy + thinc ]; - propagatedBuildInputs = [ - blis + dependencies = [ catalogue cymem jinja2 - jsonschema langcodes murmurhash numpy packaging - pathy preshed pydantic requests @@ -89,7 +82,7 @@ buildPythonPackage rec { typer wasabi weasel - ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; + ]; nativeCheckInputs = [ pytestCheckHook @@ -97,8 +90,6 @@ buildPythonPackage rec { mock ]; - doCheck = true; - # Fixes ModuleNotFoundError when running tests on Cythonized code. See #255262 preCheck = '' cd $out @@ -139,7 +130,7 @@ buildPythonPackage rec { description = "Industrial-strength Natural Language Processing (NLP)"; mainProgram = "spacy"; homepage = "https://github.com/explosion/spaCy"; - changelog = "https://github.com/explosion/spaCy/releases/tag/v${version}"; + changelog = "https://github.com/explosion/spaCy/releases/tag/release-v${version}"; license = licenses.mit; maintainers = [ ]; };