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