From ed528caa132bea8ee4fa72a84a3d8b7b4ef95d92 Mon Sep 17 00:00:00 2001 From: Lin Yinfeng Date: Fri, 22 Dec 2023 12:31:27 +0800 Subject: [PATCH 1/2] backblaze-b2: add missing dependency setuptools --- pkgs/development/tools/backblaze-b2/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/tools/backblaze-b2/default.nix b/pkgs/development/tools/backblaze-b2/default.nix index a29afaaea40d..ef6c30db5ffc 100644 --- a/pkgs/development/tools/backblaze-b2/default.nix +++ b/pkgs/development/tools/backblaze-b2/default.nix @@ -36,6 +36,7 @@ python3Packages.buildPythonApplication rec { tqdm platformdirs packaging + setuptools ]; nativeCheckInputs = with python3Packages; [ From 5ab79e192eeea36641574464e37b0f6b9eac5d14 Mon Sep 17 00:00:00 2001 From: Lin Yinfeng Date: Fri, 22 Dec 2023 16:13:56 +0800 Subject: [PATCH 2/2] backblaze-b2: add a version test --- pkgs/development/tools/backblaze-b2/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/backblaze-b2/default.nix b/pkgs/development/tools/backblaze-b2/default.nix index ef6c30db5ffc..e37fd54832c2 100644 --- a/pkgs/development/tools/backblaze-b2/default.nix +++ b/pkgs/development/tools/backblaze-b2/default.nix @@ -1,4 +1,4 @@ -{ lib, python3Packages, fetchPypi, installShellFiles }: +{ lib, python3Packages, fetchPypi, installShellFiles, testers, backblaze-b2 }: python3Packages.buildPythonApplication rec { pname = "backblaze-b2"; @@ -76,6 +76,15 @@ python3Packages.buildPythonApplication rec { --zsh <(${python3Packages.argcomplete}/bin/register-python-argcomplete backblaze-b2) ''; + passthru.tests.version = (testers.testVersion { + package = backblaze-b2; + command = "backblaze-b2 version --short"; + }).overrideAttrs (old: { + # workaround the error: Permission denied: '/homeless-shelter' + # backblaze-b2 fails to create a 'b2' directory under the XDG config path + HOME = "$(mktemp -d)"; + }); + meta = with lib; { description = "Command-line tool for accessing the Backblaze B2 storage service"; homepage = "https://github.com/Backblaze/B2_Command_Line_Tool";