Skip to content

Commit

Permalink
Merge pull request #289693 from sarahec/spacy
Browse files Browse the repository at this point in the history
python311Packages.spacy: 3.7.3 -> 3.7.4
  • Loading branch information
natsukium authored Mar 3, 2024
2 parents 11ca309 + 61791cf commit 0c6fd1b
Showing 1 changed file with 29 additions and 18 deletions.
47 changes: 29 additions & 18 deletions pkgs/development/python-modules/spacy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@
, catalogue
, cymem
, fetchPypi
, hypothesis
, jinja2
, jsonschema
, langcodes
, mock
, murmurhash
, numpy
, packaging
, pathy
, preshed
, pydantic
, pytest
, pytestCheckHook
, python
, pythonOlder
, pythonRelaxDepsHook
Expand All @@ -38,14 +40,14 @@

buildPythonPackage rec {
pname = "spacy";
version = "3.7.3";
version = "3.7.4";
pyproject = true;

disabled = pythonOlder "3.7";

src = fetchPypi {
inherit pname version;
hash = "sha256-mSZQKPvcbhIknFMwXkYfeaEDY3sOaGbCivDkY2X3UeE=";
hash = "sha256-Ul8s7S5AdhViyMrOk+9qHm6MSD8nvVZLwbFfYI776Fs=";
};

pythonRelaxDeps = [
Expand Down Expand Up @@ -83,35 +85,44 @@ buildPythonPackage rec {
typing-extensions
];

postPatch = ''
substituteInPlace setup.cfg \
--replace "thinc>=8.1.8,<8.2.0" "thinc>=8.1.8"
'';

nativeCheckInputs = [
pytest
pytestCheckHook
hypothesis
mock
];

doCheck = false;
doCheck = true;

checkPhase = ''
${python.interpreter} -m pytest spacy/tests --vectors --models --slow
# Fixes ModuleNotFoundError when running tests on Cythonized code. See #255262
preCheck = ''
cd $out
'';

pytestFlagsArray = [
"-m 'slow'"
];

disabledTests = [
# touches network
"test_download_compatibility"
"test_validate_compatibility_table"
"test_project_assets"
];

pythonImportsCheck = [
"spacy"
];

passthru = {
updateScript = writeScript "update-spacy" ''
#!${stdenv.shell}
set -eou pipefail
PATH=${lib.makeBinPath [ nix git nix-update ]}
#!${stdenv.shell}
set -eou pipefail
PATH=${lib.makeBinPath [ nix git nix-update ]}
nix-update python3Packages.spacy
nix-update python3Packages.spacy
# update spacy models as well
echo | nix-shell maintainers/scripts/update.nix --argstr package python3Packages.spacy_models.en_core_web_sm
# update spacy models as well
echo | nix-shell maintainers/scripts/update.nix --argstr package python3Packages.spacy_models.en_core_web_sm
'';
tests.annotation = callPackage ./annotation-test { };
};
Expand Down

0 comments on commit 0c6fd1b

Please sign in to comment.