1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 poetry-core,
6 pytest-asyncio,
7 pytestCheckHook,
8 pythonOlder,
9}:
10
11buildPythonPackage rec {
12 pname = "discovery30303";
13 version = "0.3.2";
14 pyproject = true;
15
16 disabled = pythonOlder "3.8";
17
18 src = fetchFromGitHub {
19 owner = "bdraco";
20 repo = "discovery30303";
21 rev = "refs/tags/v${version}";
22 hash = "sha256-P31P5GjIrMotdIXqqZ6LCbk5MIl2Kq4MzlWDw+aOcrE=";
23 };
24
25 postPatch = ''
26 substituteInPlace pyproject.toml \
27 --replace-fail " --cov=discovery30303" ""
28 '';
29
30 nativeBuildInputs = [ poetry-core ];
31
32 nativeCheckInputs = [
33 pytest-asyncio
34 pytestCheckHook
35 ];
36
37 pytestFlagsArray = [ "--asyncio-mode=auto" ];
38
39 pythonImportsCheck = [ "discovery30303" ];
40
41 meta = with lib; {
42 description = "Module to discover devices that respond on port 30303";
43 homepage = "https://github.com/bdraco/discovery30303";
44 changelog = "https://github.com/bdraco/discovery30303/releases/tag/v${version}";
45 license = licenses.asl20;
46 maintainers = with maintainers; [ fab ];
47 };
48}