2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2020-10-10 19:13:12 +01:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
, CommonMark
|
|
|
|
, dataclasses
|
2021-05-05 20:24:30 +01:00
|
|
|
, poetry-core
|
2020-10-10 19:13:12 +01:00
|
|
|
, pygments
|
|
|
|
, typing-extensions
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "rich";
|
2022-04-10 13:58:04 +01:00
|
|
|
version = "12.2.0";
|
2021-05-05 20:24:30 +01:00
|
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-10-10 19:13:12 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-03-01 04:56:46 +00:00
|
|
|
owner = "Textualize";
|
2020-10-10 19:13:12 +01:00
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-04-10 13:58:04 +01:00
|
|
|
sha256 = "02zypmnc9sijlipki0riywh82piamd3hlrl5xbg2bxlldnlnwx1d";
|
2020-10-10 19:13:12 +01:00
|
|
|
};
|
|
|
|
|
2021-05-05 20:24:30 +01:00
|
|
|
nativeBuildInputs = [ poetry-core ];
|
|
|
|
|
2020-10-10 19:13:12 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
CommonMark
|
|
|
|
pygments
|
2021-05-05 20:24:30 +01:00
|
|
|
] ++ lib.optional (pythonOlder "3.7") [
|
|
|
|
dataclasses
|
2022-03-31 15:27:27 +01:00
|
|
|
] ++ lib.optional (pythonOlder "3.9") [
|
|
|
|
typing-extensions
|
2021-05-05 20:24:30 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-10-10 19:13:12 +01:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "rich" ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-10-10 19:13:12 +01: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 19:13:12 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ris ];
|
|
|
|
};
|
|
|
|
}
|