python3Packages.llm: modernize

This commit is contained in:
Lein Matsumaru
2026-07-14 04:05:53 +00:00
parent 9408bd6e7a
commit 950bb2ca04

View File

@@ -4,7 +4,6 @@
callPackage,
buildPythonPackage,
fetchFromGitHub,
fetchpatch,
fetchpatch2,
pytestCheckHook,
replaceVars,
@@ -165,18 +164,18 @@ let
'') withPluginsArgNames
)
);
llm = buildPythonPackage rec {
llm = buildPythonPackage (finalAttrs: {
pname = "llm";
version = "0.31.1";
pyproject = true;
__structuredAttrs = true;
build-system = [ setuptools ];
src = fetchFromGitHub {
owner = "simonw";
repo = "llm";
tag = version;
tag = finalAttrs.version;
hash = "sha256-XxQ6IQyuO1rxQtiyb4VGrM7uGoffuNN5BhyI4YDxnZg=";
};
@@ -188,14 +187,6 @@ let
url = "https://github.com/simonw/llm/commit/67adad2c10be5c1898e3e1a664adb573f5d032cf.patch";
hash = "sha256-7+sBQvef94ZTUrqNKVzHzjFADNj1KNzA2tbGs5btwNA=";
})
]
# See https://github.com/NixOS/nixpkgs/issues/476258 and https://github.com/simonw/llm/pull/1334
# TODO: Remove when sqlite 3.52.x is released.
++ lib.optionals (sqlite.version == "3.51.1") [
(fetchpatch {
url = "https://github.com/simonw/llm/commit/6e24b883c3e3c4ddd2ec9006714d0a9ec17b59da.patch";
hash = "sha256-4AKQdZCr6qxuWnjWoSW6I44hPL5e7tnvREx2Ns0WwNc=";
})
];
postPatch = ''
@@ -272,7 +263,7 @@ let
meta = {
homepage = "https://github.com/simonw/llm";
description = "Access large language models from the command-line";
changelog = "https://github.com/simonw/llm/releases/tag/${src.tag}";
changelog = "https://github.com/simonw/llm/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.asl20;
mainProgram = "llm";
maintainers = with lib.maintainers; [
@@ -281,6 +272,6 @@ let
philiptaron
];
};
};
});
in
llm