forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python3Packages.llm-cmd: init at 0.2a0 (NixOS#359379)
- Loading branch information
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters