Something went wrong. Try again.
Nix Packages collection & NixOS github.com/NixOS/nixpkgs
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177{ lib, stdenv, buildPythonPackage, fetchFromGitHub, pythonAtLeast,
# build-system cymem, cython, murmurhash, numpy, preshed, thinc,
# dependencies catalogue, jinja2, langcodes, packaging, pydantic, requests, setuptools, spacy-legacy, spacy-loggers, srsly, tqdm, typer, wasabi, weasel,
# optional-dependencies spacy-transformers, spacy-lookups-data,
# tests pytest-xdist, pytestCheckHook, hypothesis, mock,
# passthru writeScript, git, nix, nix-update, callPackage,}:
buildPythonPackage (finalAttrs: { pname = "spacy"; version = "3.8.19"; pyproject = true; __structuredAttrs = true;
src = fetchFromGitHub { owner = "explosion"; repo = "spaCy"; tag = "release-v${finalAttrs.version}"; hash = "sha256-NpW6QrtmG/2X6AVWBw0W+P38ZcXOfESYAdy8N6VMirc="; };
build-system = [ cymem cython murmurhash numpy preshed thinc ];
pythonRelaxDeps = [ "thinc" ];
dependencies = [ catalogue cymem jinja2 langcodes murmurhash numpy packaging preshed pydantic requests setuptools spacy-legacy spacy-loggers srsly thinc tqdm typer wasabi weasel ];
optional-dependencies = { transformers = [ spacy-transformers ]; lookups = [ spacy-lookups-data ]; };
nativeCheckInputs = [ pytest-xdist pytestCheckHook hypothesis mock ];
# Fixes ModuleNotFoundError when running tests on Cythonized code. See #255262 preCheck = '' cd $out '';
disabledTestMarks = [ "slow" ];
disabledTests = [ # ValueError: [E002] Can't find factory for 'assert_sents' for language English (en). "test_annotating_components_from_config"
# touches network "test_download_compatibility" "test_validate_compatibility_table" "test_project_assets" "test_find_available_port"
# Tests for presence of outdated (and thus missing) spacy models # https://github.com/explosion/spaCy/issues/13856 "test_registry_entries"
# AssertionError: confection has different version in setup.cfg and in requirements.txt: # >=1.3.2,<2.0.0 and >=1.1.0,<2.0.0 respectively "test_build_dependencies" ] ++ lib.optionals (pythonAtLeast "3.14") [ # AssertionError: # assert eval["nel_macro_f"] > 0 # assert 0.0 > 0 "test_overfitting_IO_with_ner" ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ # AssertionError: assert 'V' == 'N' "test_tok2vec_frozen_overfitting" ];
pythonImportsCheck = [ "spacy" ];
passthru = { updateScript = writeScript "update-spacy" '' #!${stdenv.shell} set -eou pipefail PATH=${ lib.makeBinPath [ git nix nix-update ] }
nix-update python3Packages.spacy --version-regex 'release-v([0-9.]+)'
# 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 { }; };
__darwinAllowLocalNetworking = true; # needed for test_find_available_port
meta = { description = "Industrial-strength Natural Language Processing (NLP)"; homepage = "https://github.com/explosion/spaCy"; changelog = "https://github.com/explosion/spaCy/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ sarahec ]; mainProgram = "spacy"; };})