about summary refs log tree commit diff
path: root/pkgs/development/python-modules/discovery30303/default.nix
blob: 823207a087af49425c9102701b4145afb75eb8ae (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
{
  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 ];

  nativeCheckInputs = [
    pytest-asyncio
    pytestCheckHook
  ];

  pytestFlagsArray = [ "--asyncio-mode=auto" ];

  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 ];
  };
}