1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, mock
5, pytestCheckHook
6, pythonOlder
7, requests
8, requests-mock
9, setuptools
10}:
11
12buildPythonPackage rec {
13 pname = "py-canary";
14 version = "0.5.3";
15 format = "pyproject";
16
17 disabled = pythonOlder "3.6";
18
19 src = fetchFromGitHub {
20 owner = "snjoetw";
21 repo = pname;
22 rev = "refs/tags/${version}";
23 hash = "sha256-873XAf0jOX5pjrNRELEcTWCauk80FUYxTu7G7jc3MHE=";
24 };
25
26 nativeBuildInputs = [
27 setuptools
28 ];
29
30 propagatedBuildInputs = [
31 requests
32 ];
33
34 nativeCheckInputs = [
35 mock
36 pytestCheckHook
37 requests-mock
38 ];
39
40 pythonImportsCheck = [
41 "canary"
42 ];
43
44 disabledTests = [
45 # Test requires network access
46 "test_location_with_motion_entry"
47 ];
48
49 meta = with lib; {
50 description = "Python package for Canary Security Camera";
51 homepage = "https://github.com/snjoetw/py-canary";
52 license = licenses.mit;
53 maintainers = with maintainers; [ fab ];
54 };
55}