mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-16 18:53:17 +00:00
66 lines
1.3 KiB
Nix
66 lines
1.3 KiB
Nix
{ lib
|
|
, stdenv
|
|
, buildPythonPackage
|
|
, fetchFromGitHub
|
|
, pythonOlder
|
|
, CommonMark
|
|
, dataclasses
|
|
, poetry-core
|
|
, pygments
|
|
, typing-extensions
|
|
, pytestCheckHook
|
|
|
|
# for passthru.tests
|
|
, enrich
|
|
, httpie
|
|
, rich-rst
|
|
, textual
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "rich";
|
|
version = "12.5.1";
|
|
format = "pyproject";
|
|
disabled = pythonOlder "3.6";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "Textualize";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "sha256-FjzvFx+A4DS2XeKBZ2DGRqudvH22AUSQJnIxKs2O0AU=";
|
|
};
|
|
|
|
nativeBuildInputs = [ poetry-core ];
|
|
|
|
propagatedBuildInputs = [
|
|
CommonMark
|
|
pygments
|
|
] ++ lib.optional (pythonOlder "3.7") [
|
|
dataclasses
|
|
] ++ lib.optional (pythonOlder "3.9") [
|
|
typing-extensions
|
|
];
|
|
|
|
checkInputs = [
|
|
pytestCheckHook
|
|
];
|
|
|
|
disabledTests = lib.optionals stdenv.isDarwin [
|
|
# darwin console duplicates 3 of 4 lines
|
|
"test_rich_console_ex"
|
|
];
|
|
|
|
pythonImportsCheck = [ "rich" ];
|
|
|
|
passthru.tests = {
|
|
inherit enrich httpie rich-rst textual;
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal";
|
|
homepage = "https://github.com/Textualize/rich";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ ris jyooru ];
|
|
};
|
|
}
|