1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytest-timeout,
6 pytestCheckHook,
7 pythonOlder,
8 setuptools,
9 setuptools-scm,
10 bashInteractive,
11}:
12
13buildPythonPackage rec {
14 pname = "shtab";
15 version = "1.7.1";
16 pyproject = true;
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "iterative";
22 repo = "shtab";
23 rev = "refs/tags/v${version}";
24 hash = "sha256-8bAwLSdJCzFw5Vf9CKBrH5zOoojeXds7aIRncl+sLBI=";
25 };
26
27 postPatch = ''
28 substituteInPlace pyproject.toml \
29 --replace-fail " --cov=shtab --cov-report=term-missing --cov-report=xml" ""
30 '';
31
32 nativeBuildInputs = [
33 setuptools
34 setuptools-scm
35 ];
36
37 nativeCheckInputs = [
38 bashInteractive
39 pytest-timeout
40 pytestCheckHook
41 ];
42
43 pythonImportsCheck = [ "shtab" ];
44
45 meta = with lib; {
46 description = "Module for shell tab completion of Python CLI applications";
47 mainProgram = "shtab";
48 homepage = "https://docs.iterative.ai/shtab/";
49 changelog = "https://github.com/iterative/shtab/releases/tag/v${version}";
50 license = licenses.asl20;
51 maintainers = with maintainers; [ fab ];
52 };
53}