1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch2,
6 aiofiles,
7 aiohttp,
8 pytest-asyncio,
9 pytestCheckHook,
10 python-dateutil,
11 python-slugify,
12 pythonOlder,
13 requests,
14 setuptools,
15 sortedcontainers,
16}:
17
18buildPythonPackage rec {
19 pname = "blinkpy";
20 version = "0.23.0";
21 pyproject = true;
22
23 disabled = pythonOlder "3.9";
24
25 src = fetchFromGitHub {
26 owner = "fronzbot";
27 repo = "blinkpy";
28 tag = "v${version}";
29 hash = "sha256-MWXOxE0nxBFhkAWjy7qFPhv4AO6VjGf+fAiyaWXeiX8=";
30 };
31
32 patches = [
33 (fetchpatch2 {
34 # Fix tests with aiohttp 3.10+
35 url = "https://github.com/fronzbot/blinkpy/commit/e2c747b5ad295424b08ff4fb03204129155666fc.patch";
36 hash = "sha256-FapgAZcKBWqtAPjRl2uOFgnYPoWq6UU88XGLO7oCmDI=";
37 })
38 ];
39
40 postPatch = ''
41 substituteInPlace pyproject.toml \
42 --replace ', "wheel~=0.40.0"' "" \
43 --replace "setuptools~=68.0" "setuptools"
44 '';
45
46 nativeBuildInputs = [ setuptools ];
47
48 propagatedBuildInputs = [
49 aiofiles
50 aiohttp
51 python-dateutil
52 python-slugify
53 requests
54 sortedcontainers
55 ];
56
57 nativeCheckInputs = [
58 pytest-asyncio
59 pytestCheckHook
60 ];
61
62 pythonImportsCheck = [
63 "blinkpy"
64 "blinkpy.api"
65 "blinkpy.auth"
66 "blinkpy.blinkpy"
67 "blinkpy.camera"
68 "blinkpy.helpers.util"
69 "blinkpy.sync_module"
70 ];
71
72 meta = with lib; {
73 description = "Python library for the Blink Camera system";
74 homepage = "https://github.com/fronzbot/blinkpy";
75 changelog = "https://github.com/fronzbot/blinkpy/blob/${src.rev}/CHANGES.rst";
76 license = licenses.mit;
77 maintainers = with maintainers; [ dotlambda ];
78 };
79}