nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, CommonMark
6, dataclasses
7, poetry-core
8, pygments
9, typing-extensions
10, pytestCheckHook
11}:
12
13buildPythonPackage rec {
14 pname = "rich";
15 version = "12.4.1";
16 format = "pyproject";
17 disabled = pythonOlder "3.6";
18
19 src = fetchFromGitHub {
20 owner = "Textualize";
21 repo = pname;
22 rev = "v${version}";
23 sha256 = "sha256-6fr5mtZwXdZihoHEjF1jJxOLH3ajPX1tF2N/ZCV9g50=";
24 };
25
26 nativeBuildInputs = [ poetry-core ];
27
28 propagatedBuildInputs = [
29 CommonMark
30 pygments
31 ] ++ lib.optional (pythonOlder "3.7") [
32 dataclasses
33 ] ++ lib.optional (pythonOlder "3.9") [
34 typing-extensions
35 ];
36
37 checkInputs = [
38 pytestCheckHook
39 ];
40
41 pythonImportsCheck = [ "rich" ];
42
43 meta = with lib; {
44 description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal";
45 homepage = "https://github.com/Textualize/rich";
46 license = licenses.mit;
47 maintainers = with maintainers; [ ris ];
48 };
49}