From 4e6de4065092890204c7678ce92cf32d6e410038 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 22 Apr 2025 14:27:24 +0200 Subject: [PATCH] rich-cli: fix build --- pkgs/by-name/ri/rich-cli/package.nix | 32 +++++++++++++++++----------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/ri/rich-cli/package.nix b/pkgs/by-name/ri/rich-cli/package.nix index 93b4f94c37c6..7b98a06d3f89 100644 --- a/pkgs/by-name/ri/rich-cli/package.nix +++ b/pkgs/by-name/ri/rich-cli/package.nix @@ -1,11 +1,13 @@ { lib, + python3Packages, fetchFromGitHub, fetchpatch, - python3, + versionCheckHook, + nix-update-script, }: -python3.pkgs.buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "rich-cli"; version = "1.8.0"; pyproject = true; @@ -32,17 +34,15 @@ python3.pkgs.buildPythonApplication rec { ]; pythonRelaxDeps = [ + "rich" "textual" ]; - build-system = with python3.pkgs; [ + build-system = with python3Packages; [ poetry-core ]; - nativeBuildInputs = with python3.pkgs; [ - ]; - - dependencies = with python3.pkgs; [ + dependencies = with python3Packages; [ click requests rich @@ -50,15 +50,23 @@ python3.pkgs.buildPythonApplication rec { textual ]; - pythonImportsCheck = [ - "rich_cli" - ]; + pythonImportsCheck = [ "rich_cli" ]; - meta = with lib; { + nativeCheckInputs = [ + versionCheckHook + ]; + versionCheckProgram = "${placeholder "out"}/bin/rich"; + versionCheckProgramArg = "--version"; + + passthru = { + updateScript = nix-update-script { }; + }; + + meta = { description = "Command Line Interface to Rich"; homepage = "https://github.com/Textualize/rich-cli"; changelog = "https://github.com/Textualize/rich-cli/releases/tag/v${version}"; - license = licenses.mit; + license = lib.licenses.mit; maintainers = [ ]; mainProgram = "rich"; };