summary refs log tree commit diff
path: root/pkgs/development/python-modules/discovery30303/default.nix
blob: 49de32439d12a86b3ac08ed24cca6f39516fa4e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, poetry-core
, pytest-asyncio
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "discovery30303";
  version = "0.2.1";
  format = "pyproject";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "bdraco";
    repo = pname;
    # Commit points to 0.2.1, https://github.com/bdraco/discovery30303/issues/1
    rev = "0d0b0fdca1a98662dd2e6174d25853703bd6bf07";
    hash = "sha256-WSVMhiJxASxAkxs6RGuAVvEFS8TPxDKE9M99Rp8HKGM=";
  };

  nativeBuildInputs = [
    poetry-core
  ];

  checkInputs = [
    pytest-asyncio
    pytestCheckHook
  ];

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace " --cov=discovery30303" ""
  '';

  pythonImportsCheck = [
    "discovery30303"
  ];

  meta = with lib; {
    description = "Module to discover devices that respond on port 30303";
    homepage = "https://github.com/bdraco/discovery30303";
    license = with licenses; [ asl20 ];
    maintainers = with maintainers; [ fab ];
  };
}