1{
2 lib,
3 buildPythonPackage,
4 python,
5 fetchFromGitHub,
6 setuptools,
7 python-dateutil,
8 drf-yasg,
9 netbox,
10 netaddr,
11}:
12buildPythonPackage rec {
13 pname = "netbox-contract";
14 version = "2.4.2";
15 pyproject = true;
16
17 disabled = python.pythonVersion != netbox.python.pythonVersion;
18
19 src = fetchFromGitHub {
20 owner = "mlebreuil";
21 repo = "netbox-contract";
22 tag = "v${version}";
23 hash = "sha256-hJz6+vJWhwZJId5Otf1LaFkyaLncuuvai83aCu/aKu0=";
24 };
25
26 build-system = [ setuptools ];
27
28 dependencies = [
29 python-dateutil
30 drf-yasg
31 ];
32
33 # running tests requires initialized django project
34 nativeCheckInputs = [
35 netbox
36 netaddr
37 ];
38
39 preFixup = ''
40 export PYTHONPATH=${netbox}/opt/netbox/netbox:$PYTHONPATH
41 '';
42
43 pythonImportsCheck = [ "netbox_contract" ];
44
45 meta = {
46 description = "Contract plugin for netbox";
47 homepage = "https://github.com/mlebreuil/netbox-contract";
48 changelog = "https://github.com/mlebreuil/netbox-contract/releases/tag/${src.tag}";
49 license = lib.licenses.mit;
50 platforms = lib.platforms.linux;
51 maintainers = with lib.maintainers; [ felbinger ];
52 };
53}