This repository has no description
2.0 kB
58 lines
1{
2 python3,
3 fetchurl,
4 fetchFromGitHub,
5}:
6let
7 # Create a python environment with our overrides
8 python = python3.override {
9 self = python;
10 packageOverrides = final: prev: {
11 # Override kokoro with a more recent version and stdout support
12 kokoro = prev.kokoro.overridePythonAttrs (old: {
13 version = "0-unstable-2025-08-06";
14 src = fetchFromGitHub {
15 owner = "hexgrad";
16 repo = "kokoro";
17 rev = "dfb907a02bba8152ca444717ca5d78747ccb4bec";
18 hash = "sha256-GJlc3+RCeYaAvojFFjK22nitDTWFWp6dAPJakw+//j8=";
19 };
20 patches = (old.patches or [ ]) ++ [
21 ./stdout-support.patch
22 ];
23 passthru = (old.passthru or { }) // {
24 # Bumps kokoro (main branch) and the spacy model wheel together.
25 updateScript = ./update.sh;
26 };
27 });
28 # Spacy model - downloaded and packaged as a python package
29 spacy-en-core-web-sm = final.buildPythonPackage rec {
30 pname = "en_core_web_sm";
31 version = "3.8.0";
32 format = "wheel";
33
34 src = fetchurl {
35 url = "https://github.com/explosion/spacy-models/releases/download/${pname}-${version}/${pname}-${version}-py3-none-any.whl";
36 hash = "sha256-GTJCnbcn1L/z3u1rNM/AXfF3lPSlLusmz4ko98Gg+4U=";
37 };
38
39 propagatedBuildInputs = [ final.spacy ];
40
41 pythonImportsCheck = [ "en_core_web_sm" ];
42 };
43
44 # Create a patched misaki that doesn't try to download spacy models
45 misaki = prev.misaki.overridePythonAttrs (old: {
46 postPatch = (old.postPatch or "") + ''
47 # Patch out the spacy model download - we provide it as a dependency instead
48 substituteInPlace misaki/en.py \
49 --replace-fail "if not spacy.util.is_package(name):" "if False:" \
50 --replace-fail "spacy.cli.download(name)" "pass"
51 '';
52
53 propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ final.spacy-en-core-web-sm ];
54 });
55 };
56 };
57in
58python.pkgs.kokoro