From 27d75c273008d16f15aa3c791e4197f47abe3a72 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 2 Jan 2022 02:47:43 +0100 Subject: [PATCH] zabbix-cli: use python3, enable tests, remove maintainer The maintainer hasn't interacted with this package since it was introduced in 2017. --- pkgs/tools/misc/zabbix-cli/default.nix | 37 ++++++++++++++++---------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/pkgs/tools/misc/zabbix-cli/default.nix b/pkgs/tools/misc/zabbix-cli/default.nix index 74e7e7223d1..3732361ea83 100644 --- a/pkgs/tools/misc/zabbix-cli/default.nix +++ b/pkgs/tools/misc/zabbix-cli/default.nix @@ -1,17 +1,12 @@ -{ fetchFromGitHub, lib, python2Packages }: -let - pythonPackages = python2Packages; +{ lib +, fetchFromGitHub +, python3 +}: -in pythonPackages.buildPythonApplication rec { +python3.pkgs.buildPythonApplication rec { pname = "zabbix-cli"; version = "2.2.1"; - - propagatedBuildInputs = with pythonPackages; [ ipaddr requests ]; - - # argparse is part of the standardlib - prePatch = '' - substituteInPlace setup.py --replace "'argparse'," "" - ''; + format = "setuptools"; src = fetchFromGitHub { owner = "usit-gd"; @@ -20,10 +15,24 @@ in pythonPackages.buildPythonApplication rec { sha256 = "0wzmrn8p09ksqhhgawr179c4az7p2liqr0l4q2dra62bxliawyqz"; }; + propagatedBuildInputs = with python3.pkgs; [ + requests + ]; + + checkInputs = with python3.pkgs; [ + pytestCheckHook + ]; + + disabledTests = [ + # TypeError: option values must be strings + "test_descriptor_del" + "test_initialize" + ]; + meta = with lib; { description = "Command-line interface for Zabbix"; - homepage = src.meta.homepage; - license = [ licenses.gpl3 ]; - maintainers = [ maintainers.womfoo ]; + homepage = "https://github.com/unioslo/zabbix-cli"; + license = licenses.gpl3Plus; + maintainers = [ ]; }; }