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 000000000000..68d65069ae44 --- /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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8a3f305f1672..34fbf6957303 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1881,6 +1881,8 @@ in { click-plugins = callPackage ../development/python-modules/click-plugins { }; + click-shell = callPackage ../development/python-modules/click-shell { }; + click-spinner = callPackage ../development/python-modules/click-spinner { }; click-repl = callPackage ../development/python-modules/click-repl { };