1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 poetry-core,
8
9 # dependencies
10 markdown-it-py,
11 pygments,
12
13 # optional-dependencies
14 ipywidgets,
15
16 # tests
17 attrs,
18 pytestCheckHook,
19 which,
20
21 # for passthru.tests
22 enrich,
23 httpie,
24 rich-rst,
25 textual,
26}:
27
28buildPythonPackage rec {
29 pname = "rich";
30 version = "14.1.0";
31 pyproject = true;
32
33 src = fetchFromGitHub {
34 owner = "Textualize";
35 repo = "rich";
36 tag = "v${version}";
37 hash = "sha256-44L3eVf/gI0FlOlxzJ7/+A1jN6ILkeVEelaru1Io20U=";
38 };
39
40 build-system = [ poetry-core ];
41
42 dependencies = [
43 markdown-it-py
44 pygments
45 ];
46
47 optional-dependencies = {
48 jupyter = [ ipywidgets ];
49 };
50
51 nativeCheckInputs = [
52 attrs
53 pytestCheckHook
54 which
55 ];
56
57 pythonImportsCheck = [ "rich" ];
58
59 passthru.tests = {
60 inherit
61 enrich
62 httpie
63 rich-rst
64 textual
65 ;
66 };
67
68 meta = with lib; {
69 description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal";
70 homepage = "https://github.com/Textualize/rich";
71 changelog = "https://github.com/Textualize/rich/blob/v${version}/CHANGELOG.md";
72 license = licenses.mit;
73 maintainers = with maintainers; [ ris ];
74 };
75}