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