1{ lib
2, aiohttp
3, aresponses
4, backoff
5, beautifulsoup4
6, buildPythonPackage
7, docutils
8, fetchFromGitHub
9, fetchpatch
10, poetry-core
11, pytest-aiohttp
12, pytest-asyncio
13, pytestCheckHook
14, pythonOlder
15, pytz
16, types-pytz
17, voluptuous
18, websockets
19}:
20
21buildPythonPackage rec {
22 pname = "simplisafe-python";
23 version = "2023.08.0";
24 format = "pyproject";
25
26 disabled = pythonOlder "3.9";
27
28 src = fetchFromGitHub {
29 owner = "bachya";
30 repo = pname;
31 rev = "refs/tags/${version}";
32 hash = "sha256-DExMa9z/VYAMoqUmr/gfZzYFWfTxnC+Cz4rRTaNSLBM=";
33 };
34
35 patches = [
36 # This patch removes references to setuptools and wheel that are no longer
37 # necessary and changes poetry to poetry-core, so that we don't need to add
38 # unnecessary nativeBuildInputs.
39 #
40 # https://github.com/bachya/simplisafe-python/pull/596
41 #
42 (fetchpatch {
43 name = "clean-up-build-dependencies.patch";
44 url = "https://github.com/bachya/simplisafe-python/commit/60f41c690fac7acb614490b542cbbf2fa0052266.patch";
45 hash = "sha256-RLRbHmaR2A8MNc96WHx0L8ccyygoBUaOulAuRJkFuUM=";
46 })
47 ];
48
49 nativeBuildInputs = [
50 poetry-core
51 ];
52
53 propagatedBuildInputs = [
54 aiohttp
55 backoff
56 beautifulsoup4
57 docutils
58 pytz
59 voluptuous
60 websockets
61 ];
62
63 nativeCheckInputs = [
64 aresponses
65 pytest-aiohttp
66 pytest-asyncio
67 pytestCheckHook
68 types-pytz
69 ];
70
71 disabledTests = [
72 # simplipy/api.py:253: InvalidCredentialsError
73 "test_request_error_failed_retry"
74 "test_update_error"
75 # ClientConnectorError: Cannot connect to host auth.simplisafe.com:443 ssl:default [Temporary failure in name resolution]
76 "test_client_async_from_refresh_token_unknown_error"
77 ];
78
79 disabledTestPaths = [
80 # Ignore the examples as they are prefixed with test_
81 "examples/"
82 ];
83
84 pythonImportsCheck = [
85 "simplipy"
86 ];
87
88 __darwinAllowLocalNetworking = true;
89
90 meta = with lib; {
91 changelog = "https://github.com/bachya/simplisafe-python/releases/tag/${version}";
92 description = "Python library the SimpliSafe API";
93 homepage = "https://simplisafe-python.readthedocs.io/";
94 license = with licenses; [ mit ];
95 maintainers = with maintainers; [ fab ];
96 };
97}