about summary refs log tree commit diff
path: root/pkgs/development/python-modules/shtab/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/shtab/default.nix')
-rw-r--r--pkgs/development/python-modules/shtab/default.nix52
1 files changed, 52 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/shtab/default.nix b/pkgs/development/python-modules/shtab/default.nix
new file mode 100644
index 0000000000000..78e160058b238
--- /dev/null
+++ b/pkgs/development/python-modules/shtab/default.nix
@@ -0,0 +1,52 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pytest-timeout
+, pytestCheckHook
+, pythonOlder
+, setuptools-scm
+, bashInteractive
+}:
+
+buildPythonPackage rec {
+  pname = "shtab";
+  version = "1.5.3";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.7";
+
+  src = fetchFromGitHub {
+    owner = "iterative";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-Wuc4m3VdOGEcevYXUpbL4gTvyW9t13pj57zPYdqx0UY=";
+  };
+
+  SETUPTOOLS_SCM_PRETEND_VERSION = version;
+
+  nativeBuildInputs = [
+    setuptools-scm
+  ];
+
+  checkInputs = [
+    bashInteractive
+    pytest-timeout
+    pytestCheckHook
+  ];
+
+  postPatch = ''
+    substituteInPlace setup.cfg \
+      --replace " --cov=shtab --cov-report=term-missing --cov-report=xml" ""
+  '';
+
+  pythonImportsCheck = [
+    "shtab"
+  ];
+
+  meta = with lib; {
+    description = "Module for shell tab completion of Python CLI applications";
+    homepage = "https://docs.iterative.ai/shtab/";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ fab ];
+  };
+}