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