about summary refs log tree commit diff
path: root/pkgs/development/python-modules/click-shell/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/click-shell/default.nix')
-rw-r--r--pkgs/development/python-modules/click-shell/default.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/click-shell/default.nix b/pkgs/development/python-modules/click-shell/default.nix
new file mode 100644
index 0000000000000..68d65069ae443
--- /dev/null
+++ b/pkgs/development/python-modules/click-shell/default.nix
@@ -0,0 +1,49 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, click
+, pytestCheckHook
+, pytest-click
+}:
+
+buildPythonPackage rec {
+  pname = "click-shell";
+  version = "2.1";
+  format = "setuptools";
+
+  # PyPi release is missing tests
+  src = fetchFromGitHub {
+    owner = "clarkperkins";
+    repo = pname;
+    rev = "refs/tags/${version}";
+    hash = "sha256-4QpQzg0yFuOFymGiTI+A8o6LyX78iTJMqr0ernYbilI=";
+  };
+
+  propagatedBuildInputs = [
+    click
+  ];
+
+  checkInputs = [
+    pytest-click
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [
+    "click_shell"
+  ];
+
+  preCheck = "export HOME=$(mktemp -d)";
+
+  meta = with lib; {
+    description = "An extension to click that easily turns your click app into a shell utility";
+    longDescription = ''
+      This is an extension to click that easily turns your click app into a
+      shell utility. It is built on top of the built in python cmd module,
+      with modifications to make it work with click. It adds a 'shell' mode
+      with command completion to any click app.
+    '';
+    homepage = "https://github.com/clarkperkins/click-shell";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ binsky ];
+  };
+}