2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-10-16 20:44:37 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
, CommonMark
|
2021-05-20 23:08:51 +00:00
|
|
|
, poetry-core
|
2020-10-16 20:44:37 +00:00
|
|
|
, pygments
|
|
|
|
, typing-extensions
|
|
|
|
, pytestCheckHook
|
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";
|
2022-12-17 10:02:37 +00:00
|
|
|
version = "12.6.0";
|
2021-05-20 23:08:51 +00:00
|
|
|
format = "pyproject";
|
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;
|
|
|
|
rev = "v${version}";
|
2022-12-17 10:02:37 +00:00
|
|
|
hash = "sha256-g3tXftEoBCJ1pMdLyDBXQvY9haGMQkuY1/UBOtUqrLE=";
|
2020-10-16 20:44:37 +00:00
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
nativeBuildInputs = [ poetry-core ];
|
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
CommonMark
|
|
|
|
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
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-10-16 20:44:37 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "rich" ];
|
|
|
|
|
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";
|
2020-10-16 20:44:37 +00:00
|
|
|
license = licenses.mit;
|
2022-08-12 12:06:08 +00:00
|
|
|
maintainers = with maintainers; [ ris jyooru ];
|
2020-10-16 20:44:37 +00:00
|
|
|
};
|
|
|
|
}
|