python3Packages.llm-cmd: init at 0.2a0 (#359379)

This commit is contained in:
Gaétan Lepage
2025-01-08 22:39:35 +01:00
committed by GitHub
3 changed files with 70 additions and 0 deletions
@@ -0,0 +1,55 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
setuptools,
llm,
# dependencies
prompt-toolkit,
pygments,
# tests
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "llm-cmd";
version = "0.2a0";
pyproject = true;
src = fetchFromGitHub {
owner = "simonw";
repo = "llm-cmd";
tag = version;
hash = "sha256-RhwQEllpee/XP1p0nrgL4m+KjSZzf61J8l1jJGlg94E=";
};
# Only needed until https://github.com/simonw/llm-cmd/pull/18 is merged and released
patches = [ ./fix-test.patch ];
build-system = [
setuptools
# Follows the reasoning from https://github.com/NixOS/nixpkgs/pull/327800#discussion_r1681586659 about including llm in build-system
llm
];
dependencies = [
prompt-toolkit
pygments
];
nativeCheckInputs = [
pytestCheckHook
];
pythonImportCheck = [
"llm_cmd"
];
meta = {
description = "Use LLM to generate and execute commands in your shell";
homepage = "https://github.com/simonw/llm-cmd";
changelog = "https://github.com/simonw/llm-cmd/releases/tag/${version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ erethon ];
};
}
@@ -0,0 +1,13 @@
diff --git a/tests/test_cmd.py b/tests/test_cmd.py
index 02b5db8..578ebaa 100644
--- a/tests/test_cmd.py
+++ b/tests/test_cmd.py
@@ -1,6 +1,7 @@
-from llm.plugins import pm
+from llm.plugins import load_plugins, pm
def test_plugin_is_installed():
+ load_plugins()
names = [mod.__name__ for mod in pm.get_plugins()]
assert "llm_cmd" in names
+2
View File
@@ -7623,6 +7623,8 @@ self: super: with self; {
llm = callPackage ../development/python-modules/llm { };
llm-cmd = callPackage ../development/python-modules/llm-cmd { };
llm-gguf = callPackage ../development/python-modules/llm-gguf { };
llm-ollama = callPackage ../development/python-modules/llm-ollama { };