1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, CommonMark
6, colorama
7, dataclasses
8, poetry-core
9, pygments
10, typing-extensions
11, pytestCheckHook
12}:
13
14buildPythonPackage rec {
15 pname = "rich";
16 version = "10.12.0";
17 format = "pyproject";
18 disabled = pythonOlder "3.6";
19
20 src = fetchFromGitHub {
21 owner = "willmcgugan";
22 repo = pname;
23 rev = "v${version}";
24 sha256 = "1qq4k0pxq3r0463z4h65i9rb8cvilpnqmparklj5y5qk6svz0y2n";
25 };
26
27 nativeBuildInputs = [ poetry-core ];
28
29 propagatedBuildInputs = [
30 CommonMark
31 colorama
32 pygments
33 typing-extensions
34 ] ++ lib.optional (pythonOlder "3.7") [
35 dataclasses
36 ];
37
38 checkInputs = [
39 pytestCheckHook
40 ];
41
42 pythonImportsCheck = [ "rich" ];
43
44 meta = with lib; {
45 description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal";
46 homepage = "https://github.com/willmcgugan/rich";
47 license = licenses.mit;
48 maintainers = with maintainers; [ ris ];
49 };
50}