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

authored by Gaétan Lepage and committed by GitHub f9aff72b 0b5b7169

+70
+55
pkgs/development/python-modules/llm-cmd/default.nix
··· 1 + { 2 + lib, 3 + buildPythonPackage, 4 + fetchFromGitHub, 5 + # build-system 6 + setuptools, 7 + llm, 8 + # dependencies 9 + prompt-toolkit, 10 + pygments, 11 + # tests 12 + pytestCheckHook, 13 + }: 14 + 15 + buildPythonPackage rec { 16 + pname = "llm-cmd"; 17 + version = "0.2a0"; 18 + pyproject = true; 19 + 20 + src = fetchFromGitHub { 21 + owner = "simonw"; 22 + repo = "llm-cmd"; 23 + tag = version; 24 + hash = "sha256-RhwQEllpee/XP1p0nrgL4m+KjSZzf61J8l1jJGlg94E="; 25 + }; 26 + 27 + # Only needed until https://github.com/simonw/llm-cmd/pull/18 is merged and released 28 + patches = [ ./fix-test.patch ]; 29 + build-system = [ 30 + setuptools 31 + # Follows the reasoning from https://github.com/NixOS/nixpkgs/pull/327800#discussion_r1681586659 about including llm in build-system 32 + llm 33 + ]; 34 + 35 + dependencies = [ 36 + prompt-toolkit 37 + pygments 38 + ]; 39 + 40 + nativeCheckInputs = [ 41 + pytestCheckHook 42 + ]; 43 + 44 + pythonImportCheck = [ 45 + "llm_cmd" 46 + ]; 47 + 48 + meta = { 49 + description = "Use LLM to generate and execute commands in your shell"; 50 + homepage = "https://github.com/simonw/llm-cmd"; 51 + changelog = "https://github.com/simonw/llm-cmd/releases/tag/${version}"; 52 + license = lib.licenses.asl20; 53 + maintainers = with lib.maintainers; [ erethon ]; 54 + }; 55 + }
+13
pkgs/development/python-modules/llm-cmd/fix-test.patch
··· 1 + diff --git a/tests/test_cmd.py b/tests/test_cmd.py 2 + index 02b5db8..578ebaa 100644 3 + --- a/tests/test_cmd.py 4 + +++ b/tests/test_cmd.py 5 + @@ -1,6 +1,7 @@ 6 + -from llm.plugins import pm 7 + +from llm.plugins import load_plugins, pm 8 + 9 + 10 + def test_plugin_is_installed(): 11 + + load_plugins() 12 + names = [mod.__name__ for mod in pm.get_plugins()] 13 + assert "llm_cmd" in names
+2
pkgs/top-level/python-packages.nix
··· 7623 7623 7624 7624 llm = callPackage ../development/python-modules/llm { }; 7625 7625 7626 + llm-cmd = callPackage ../development/python-modules/llm-cmd { }; 7627 + 7626 7628 llm-gguf = callPackage ../development/python-modules/llm-gguf { }; 7627 7629 7628 7630 llm-ollama = callPackage ../development/python-modules/llm-ollama { };