1{
2 lib,
3 async-timeout,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pythonAtLeast,
7 pythonOlder,
8 pytest-asyncio,
9 setuptools,
10 pytestCheckHook,
11}:
12
13buildPythonPackage rec {
14 pname = "screenlogicpy";
15 version = "0.10.2";
16 pyproject = true;
17
18 disabled = pythonOlder "3.10";
19
20 src = fetchFromGitHub {
21 owner = "dieselrabbit";
22 repo = "screenlogicpy";
23 tag = "v${version}";
24 hash = "sha256-o/NcLassEaucnWqu5fnYA19wFwCPCT9nYKBeHzFZTKo=";
25 };
26
27 nativeBuildInputs = [ setuptools ];
28
29 propagatedBuildInputs = [ async-timeout ];
30
31 nativeCheckInputs = [
32 pytest-asyncio
33 pytestCheckHook
34 ];
35
36 disabledTests = [
37 # Tests require network access
38 "test_async_discovery"
39 "test_async"
40 "test_asyncio_gateway_discovery"
41 "test_discovery_async_discover"
42 "test_gateway_discovery"
43 "test_gateway"
44 ]
45 ++ lib.optionals (pythonAtLeast "3.12") [
46 # Tests block on Python 3.12
47 "test_sub_unsub"
48 "test_attach_existing"
49 "test_login_async_connect_to_gateway"
50 "test_login_async_gateway_connect"
51 ];
52
53 pythonImportsCheck = [ "screenlogicpy" ];
54
55 meta = with lib; {
56 description = "Python interface for Pentair Screenlogic devices";
57 mainProgram = "screenlogicpy";
58 homepage = "https://github.com/dieselrabbit/screenlogicpy";
59 changelog = "https://github.com/dieselrabbit/screenlogicpy/releases/tag/${src.tag}";
60 license = with licenses; [ gpl3Only ];
61 maintainers = with maintainers; [ fab ];
62 };
63}