1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 pytestCheckHook,
7 pythonAtLeast,
8 pythonOlder,
9 setuptools,
10}:
11
12buildPythonPackage rec {
13 pname = "py-zabbix";
14 version = "1.1.7";
15 pyproject = true;
16
17 disabled = pythonOlder "3.8";
18
19 src = fetchFromGitHub {
20 owner = "adubkov";
21 repo = "py-zabbix";
22 tag = version;
23 hash = "sha256-aPQc188pszfDQvNtsGYlRLHS5CG5VyqptSoe4/GJVvE=";
24 };
25
26 patches = [
27 # Remove Python2 comp, https://github.com/adubkov/py-zabbix/pull/154
28 (fetchpatch {
29 name = "no-more-py2.patch";
30 url = "https://github.com/adubkov/py-zabbix/commit/8deedb860f52870fbeacc54a40341520702341e2.patch";
31 hash = "sha256-Af7pnCZIObC0ZQLaamBK1pTAVAFs/Mh7+og5jAKqk4s=";
32 })
33 ];
34
35 build-system = [ setuptools ];
36
37 nativeCheckInputs = [ pytestCheckHook ];
38
39 pythonImportsCheck = [ "pyzabbix" ];
40
41 disabledTests = lib.optionals (pythonAtLeast "3.12") [
42 # AttributeError: 'RawConfigParser' object has no attribute 'readfp'
43 "config"
44 ];
45
46 meta = with lib; {
47 description = "Python module to interact with Zabbix";
48 homepage = "https://github.com/adubkov/py-zabbix";
49 changelog = "https://github.com/adubkov/py-zabbix/releases/tag/${version}";
50 license = licenses.gpl2Only;
51 maintainers = with maintainers; [ fab ];
52 };
53}