Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 python3Packages,
4 fetchFromGitHub,
5 fetchpatch,
6 versionCheckHook,
7 nix-update-script,
8}:
9
10python3Packages.buildPythonApplication rec {
11 pname = "rich-cli";
12 version = "1.8.0";
13 pyproject = true;
14
15 src = fetchFromGitHub {
16 owner = "Textualize";
17 repo = "rich-cli";
18 tag = "v${version}";
19 hash = "sha256-mV5b/J9wX9niiYtlmAUouaAm9mY2zTtDmex7FNWcezQ=";
20 };
21
22 patches = [
23 # Update dependencies, https://github.com/Textualize/rich-cli/pull/94
24 (fetchpatch {
25 name = "update-dependencies.patch";
26 url = "https://github.com/Textualize/rich-cli/pull/94/commits/1e9a11af7c1c78a5a44a207b1e0dce4c4b3c39f0.patch";
27 hash = "sha256-cU+s/LK2GDVWXLZob0n5J6sLjflCr8w10hRLgeWN5Vg=";
28 })
29 (fetchpatch {
30 name = "markdown.patch";
31 url = "https://github.com/Textualize/rich-cli/pull/94/commits/0a8e77d724ace88ce88ee9d68a46b1dc8464fe0b.patch";
32 hash = "sha256-KXvRG36Qj5kCj1RiAJsNkoJY7t41zUfJFgHeCtc0O4w=";
33 })
34 ];
35
36 pythonRelaxDeps = [
37 "rich"
38 "textual"
39 ];
40
41 build-system = with python3Packages; [
42 poetry-core
43 ];
44
45 dependencies = with python3Packages; [
46 click
47 requests
48 rich
49 rich-rst
50 textual
51 ];
52
53 pythonImportsCheck = [ "rich_cli" ];
54
55 nativeCheckInputs = [
56 versionCheckHook
57 ];
58 versionCheckProgram = "${placeholder "out"}/bin/rich";
59 versionCheckProgramArg = "--version";
60
61 passthru = {
62 updateScript = nix-update-script { };
63 };
64
65 meta = {
66 description = "Command Line Interface to Rich";
67 homepage = "https://github.com/Textualize/rich-cli";
68 changelog = "https://github.com/Textualize/rich-cli/releases/tag/v${version}";
69 license = lib.licenses.mit;
70 maintainers = [ ];
71 mainProgram = "rich";
72 };
73}