1{ lib
2, buildPythonPackage
3, click
4, fetchFromGitHub
5, pythonOlder
6, rich
7, typer
8}:
9
10buildPythonPackage rec {
11 pname = "rich-click";
12 version = "1.5.2";
13 format = "setuptools";
14
15 disabled = pythonOlder "3.8";
16
17 src = fetchFromGitHub {
18 owner = "ewels";
19 repo = pname;
20 rev = "v${version}";
21 hash = "sha256-eW5CR7ReVsFLJ09F4EUQbvFB+GdlnTay0bX4NNLQ0xo=";
22 };
23
24 propagatedBuildInputs = [
25 click
26 rich
27 ];
28
29 passthru.optional-dependencies = {
30 typer = [
31 typer
32 ];
33 };
34
35 postPatch = ''
36 substituteInPlace setup.py \
37 --replace "typer>=0.4,<0.6" "typer>=0.4"
38 '';
39
40 # Module has no test
41 doCheck = false;
42
43 pythonImportsCheck = [
44 "rich_click"
45 ];
46
47 meta = with lib; {
48 description = "Module to format click help output nicely with rich";
49 homepage = "https://github.com/ewels/rich-click";
50 license = licenses.mit;
51 maintainers = with maintainers; [ fab ];
52 };
53}