2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-10-16 20:44:37 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
2024-01-13 08:15:51 +00:00
|
|
|
|
|
|
|
# build-system
|
2021-05-20 23:08:51 +00:00
|
|
|
, poetry-core
|
2024-01-13 08:15:51 +00:00
|
|
|
|
|
|
|
# dependencies
|
|
|
|
, markdown-it-py
|
2020-10-16 20:44:37 +00:00
|
|
|
, pygments
|
|
|
|
, typing-extensions
|
2024-01-13 08:15:51 +00:00
|
|
|
|
|
|
|
# optional-dependencies
|
|
|
|
, ipywidgets
|
|
|
|
|
|
|
|
# tests
|
|
|
|
, attrs
|
2020-10-16 20:44:37 +00:00
|
|
|
, pytestCheckHook
|
2023-05-24 13:37:59 +00:00
|
|
|
, setuptools
|
2022-08-21 13:32:41 +00:00
|
|
|
|
|
|
|
# for passthru.tests
|
|
|
|
, enrich
|
|
|
|
, httpie
|
|
|
|
, rich-rst
|
|
|
|
, textual
|
2020-10-16 20:44:37 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "rich";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "13.7.0";
|
2021-05-20 23:08:51 +00:00
|
|
|
format = "pyproject";
|
2023-03-15 16:39:30 +00:00
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-10-16 20:44:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-04-15 01:41:22 +00:00
|
|
|
owner = "Textualize";
|
2020-10-16 20:44:37 +00:00
|
|
|
repo = pname;
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-L72an7vHC+aBj8NlLOjofDrQGvmFxJpdbfiEubfg0GM=";
|
2020-10-16 20:44:37 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
propagatedBuildInputs = [
|
2023-03-15 16:39:30 +00:00
|
|
|
markdown-it-py
|
2020-10-16 20:44:37 +00:00
|
|
|
pygments
|
2022-10-30 15:09:59 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.9") [
|
2022-04-27 09:35:20 +00:00
|
|
|
typing-extensions
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
jupyter = [
|
|
|
|
ipywidgets
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2024-01-13 08:15:51 +00:00
|
|
|
attrs
|
2021-05-20 23:08:51 +00:00
|
|
|
pytestCheckHook
|
2024-01-13 08:15:51 +00:00
|
|
|
setuptools
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
2020-10-16 20:44:37 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
disabledTests = [
|
|
|
|
# pygments 2.16 compat
|
|
|
|
# https://github.com/Textualize/rich/issues/3088
|
|
|
|
"test_card_render"
|
|
|
|
"test_markdown_render"
|
|
|
|
"test_markdown_render"
|
|
|
|
"test_python_render"
|
|
|
|
"test_python_render_simple"
|
|
|
|
"test_python_render_simple_passing_lexer_instance"
|
|
|
|
"test_python_render_indent_guides"
|
|
|
|
"test_option_no_wrap"
|
|
|
|
"test_syntax_highlight_ranges"
|
|
|
|
];
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"rich"
|
|
|
|
];
|
2020-10-16 20:44:37 +00:00
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit enrich httpie rich-rst textual;
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-10-16 20:44:37 +00:00
|
|
|
description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal";
|
2022-04-15 01:41:22 +00:00
|
|
|
homepage = "https://github.com/Textualize/rich";
|
2023-03-15 16:39:30 +00:00
|
|
|
changelog = "https://github.com/Textualize/rich/blob/v${version}/CHANGELOG.md";
|
2020-10-16 20:44:37 +00:00
|
|
|
license = licenses.mit;
|
2023-01-20 10:41:00 +00:00
|
|
|
maintainers = with maintainers; [ ris joelkoen ];
|
2020-10-16 20:44:37 +00:00
|
|
|
};
|
|
|
|
}
|