Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / rich / default.nix
blob518be3f4e2feafc8af8743ca7e1e27929bca87e8
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , pythonOlder
6 # build-system
7 , poetry-core
9 # dependencies
10 , markdown-it-py
11 , pygments
12 , typing-extensions
14 # optional-dependencies
15 , ipywidgets
17 # tests
18 , attrs
19 , pytestCheckHook
20 , setuptools
22 # for passthru.tests
23 , enrich
24 , httpie
25 , rich-rst
26 , textual
29 buildPythonPackage rec {
30   pname = "rich";
31   version = "13.7.1";
32   format = "pyproject";
34   disabled = pythonOlder "3.7";
36   src = fetchFromGitHub {
37     owner = "Textualize";
38     repo = pname;
39     rev = "refs/tags/v${version}";
40     hash = "sha256-7LvmPrCpHfPEfJ1r8IFnQhYkBstvtIrWYhGwcchlc0s=";
41   };
43   nativeBuildInputs = [
44     poetry-core
45   ];
47   propagatedBuildInputs = [
48     markdown-it-py
49     pygments
50   ] ++ lib.optionals (pythonOlder "3.9") [
51     typing-extensions
52   ];
54   passthru.optional-dependencies = {
55     jupyter = [
56       ipywidgets
57     ];
58   };
60   nativeCheckInputs = [
61     attrs
62     pytestCheckHook
63     setuptools
64   ];
66   disabledTests = [
67     # pygments 2.16 compat
68     # https://github.com/Textualize/rich/issues/3088
69     "test_card_render"
70     "test_markdown_render"
71     "test_markdown_render"
72     "test_python_render"
73     "test_python_render_simple"
74     "test_python_render_simple_passing_lexer_instance"
75     "test_python_render_indent_guides"
76     "test_option_no_wrap"
77     "test_syntax_highlight_ranges"
78   ];
80   pythonImportsCheck = [
81     "rich"
82   ];
84   passthru.tests = {
85     inherit enrich httpie rich-rst textual;
86   };
88   meta = with lib; {
89     description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal";
90     homepage = "https://github.com/Textualize/rich";
91     changelog = "https://github.com/Textualize/rich/blob/v${version}/CHANGELOG.md";
92     license = licenses.mit;
93     maintainers = with maintainers; [ ris joelkoen ];
94   };