1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 poetry-core,
8
9 # dependencies
10 scapy,
11
12 # tests
13 pytest-asyncio,
14 pytestCheckHook,
15}:
16
17buildPythonPackage rec {
18 pname = "aiodhcpwatcher";
19 version = "1.2.1";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "bdraco";
24 repo = "aiodhcpwatcher";
25 rev = "v${version}";
26 hash = "sha256-+BF3sBam8O9I4tY7QqnA4iNcJFsK9+imS8pY3N/v1HY=";
27 };
28
29 postPatch = ''
30 sed -i "/addopts =/d" pyproject.toml
31 '';
32
33 build-system = [ poetry-core ];
34
35 dependencies = [ scapy ];
36
37 nativeCheckInputs = [
38 pytest-asyncio
39 pytestCheckHook
40 ];
41
42 preCheck = ''
43 export HOME=$TMPDIR
44 '';
45
46 pythonImportsCheck = [ "aiodhcpwatcher" ];
47
48 meta = with lib; {
49 description = "Watch for DHCP packets with asyncio";
50 homepage = "https://github.com/bdraco/aiodhcpwatcher";
51 changelog = "https://github.com/bdraco/aiodhcpwatcher/blob/${src.rev}/CHANGELOG.md";
52 license = licenses.asl20;
53 maintainers = with maintainers; [ hexa ];
54 platforms = platforms.linux;
55 };
56}