nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, poetry-core
6, pytest-asyncio
7, pytestCheckHook
8}:
9
10buildPythonPackage rec {
11 pname = "discovery30303";
12 version = "0.2.1";
13 format = "pyproject";
14
15 disabled = pythonOlder "3.7";
16
17 src = fetchFromGitHub {
18 owner = "bdraco";
19 repo = pname;
20 # Commit points to 0.2.1, https://github.com/bdraco/discovery30303/issues/1
21 rev = "0d0b0fdca1a98662dd2e6174d25853703bd6bf07";
22 hash = "sha256-WSVMhiJxASxAkxs6RGuAVvEFS8TPxDKE9M99Rp8HKGM=";
23 };
24
25 nativeBuildInputs = [
26 poetry-core
27 ];
28
29 checkInputs = [
30 pytest-asyncio
31 pytestCheckHook
32 ];
33
34 postPatch = ''
35 substituteInPlace pyproject.toml \
36 --replace " --cov=discovery30303" ""
37 '';
38
39 pythonImportsCheck = [
40 "discovery30303"
41 ];
42
43 meta = with lib; {
44 description = "Module to discover devices that respond on port 30303";
45 homepage = "https://github.com/bdraco/discovery30303";
46 license = with licenses; [ asl20 ];
47 maintainers = with maintainers; [ fab ];
48 };
49}