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