2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2022-07-15 23:58:31 +00:00
|
|
|
, stdenv
|
2020-10-10 18:13:12 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
, CommonMark
|
|
|
|
, dataclasses
|
2021-05-05 19:24:30 +00:00
|
|
|
, poetry-core
|
2020-10-10 18:13:12 +00:00
|
|
|
, pygments
|
|
|
|
, typing-extensions
|
|
|
|
, pytestCheckHook
|
2022-07-14 19:02:02 +00:00
|
|
|
|
|
|
|
# for passthru.tests
|
|
|
|
, enrich
|
|
|
|
, httpie
|
|
|
|
, rich-rst
|
|
|
|
, textual
|
2020-10-10 18:13:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "rich";
|
2022-07-15 23:58:31 +00:00
|
|
|
version = "12.5.1";
|
2021-05-05 19:24:30 +00:00
|
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-10-10 18:13:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-03-01 04:56:46 +00:00
|
|
|
owner = "Textualize";
|
2020-10-10 18:13:12 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-07-15 23:58:31 +00:00
|
|
|
sha256 = "sha256-FjzvFx+A4DS2XeKBZ2DGRqudvH22AUSQJnIxKs2O0AU=";
|
2020-10-10 18:13:12 +00:00
|
|
|
};
|
|
|
|
|
2021-05-05 19:24:30 +00:00
|
|
|
nativeBuildInputs = [ poetry-core ];
|
|
|
|
|
2020-10-10 18:13:12 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
CommonMark
|
|
|
|
pygments
|
2021-05-05 19:24:30 +00:00
|
|
|
] ++ lib.optional (pythonOlder "3.7") [
|
|
|
|
dataclasses
|
2022-03-31 14:27:27 +00:00
|
|
|
] ++ lib.optional (pythonOlder "3.9") [
|
|
|
|
typing-extensions
|
2021-05-05 19:24:30 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-10-10 18:13:12 +00:00
|
|
|
|
2022-07-15 23:58:31 +00:00
|
|
|
disabledTests = lib.optionals stdenv.isDarwin [
|
|
|
|
# darwin console duplicates 3 of 4 lines
|
|
|
|
"test_rich_console_ex"
|
|
|
|
];
|
|
|
|
|
2020-10-10 18:13:12 +00:00
|
|
|
pythonImportsCheck = [ "rich" ];
|
|
|
|
|
2022-07-14 19:02:02 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit enrich httpie rich-rst textual;
|
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-10-10 18:13:12 +00:00
|
|
|
description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal";
|
2022-03-01 04:56:46 +00:00
|
|
|
homepage = "https://github.com/Textualize/rich";
|
2020-10-10 18:13:12 +00:00
|
|
|
license = licenses.mit;
|
2022-07-15 23:58:31 +00:00
|
|
|
maintainers = with maintainers; [ ris jyooru ];
|
2020-10-10 18:13:12 +00:00
|
|
|
};
|
|
|
|
}
|