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