1{ lib
2, aiohttp
3, aiounittest
4, buildPythonPackage
5, fetchFromGitHub
6, ffmpeg-python
7, pytestCheckHook
8, pythonOlder
9, requests
10}:
11
12buildPythonPackage rec {
13 pname = "reolink-aio";
14 version = "0.5.15";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.9";
18
19 src = fetchFromGitHub {
20 owner = "starkillerOG";
21 repo = "reolink_aio";
22 rev = "refs/tags/${version}";
23 hash = "sha256-YTBx0tMWSyy6A1OuTBmfEpRnZE4gHLIY5qFH9YL+YEo=";
24 };
25
26 postPatch = ''
27 # Packages in nixpkgs is different than the module name
28 substituteInPlace setup.py \
29 --replace "ffmpeg" "ffmpeg-python"
30 '';
31 propagatedBuildInputs = [
32 aiohttp
33 ffmpeg-python
34 requests
35 ];
36
37 doCheck = false; # all testse require a network device
38
39 nativeCheckInputs = [
40 aiounittest
41 pytestCheckHook
42 ];
43
44 pytestFlagsArray = [
45 "tests/test.py"
46 ];
47
48 disabledTests = [
49 # Tests require network access
50 "test1_settings"
51 "test2_states"
52 "test3_images"
53 "test4_properties"
54 "test_succes"
55 "test_wrong_host"
56 "test_wrong_password"
57 "test_wrong_user"
58 ];
59
60 pythonImportsCheck = [
61 "reolink_aio"
62 ];
63
64 meta = with lib; {
65 description = "Module to interact with the Reolink IP camera API";
66 homepage = "https://github.com/starkillerOG/reolink_aio";
67 changelog = "https://github.com/starkillerOG/reolink_aio/releases/tag/${version}";
68 license = with licenses; [ mit ];
69 maintainers = with maintainers; [ fab ];
70 };
71}