1{ lib
2, aiohttp
3, buildPythonPackage
4, fetchFromGitHub
5, pytest-mock
6, pytestCheckHook
7, pythonOlder
8, requests
9, websocket_client
10, zeroconf
11}:
12
13buildPythonPackage rec {
14 pname = "devolo-home-control-api";
15 version = "0.17.3";
16 disabled = pythonOlder "3.6";
17
18 src = fetchFromGitHub {
19 owner = "2Fake";
20 repo = "devolo_home_control_api";
21 rev = "v${version}";
22 sha256 = "1h7admqb1l28sxwhhkkhw0sfzgpn8zpczvmi3h28f68csflkv379";
23 };
24
25 propagatedBuildInputs = [
26 requests
27 zeroconf
28 websocket_client
29 ];
30
31 checkInputs = [
32 pytestCheckHook
33 pytest-mock
34 ];
35
36 postPatch = ''
37 # setup.py is not able to detect the version with setuptools_scm
38 substituteInPlace setup.py \
39 --replace "setuptools_scm" "" \
40 --replace 'use_scm_version=True' 'use_scm_version="${version}"'
41 '';
42
43 # Disable test that requires network access
44 disabledTests = [
45 "test__on_pong"
46 "TestMprm"
47 ];
48
49 pythonImportsCheck = [ "devolo_home_control_api" ];
50
51 meta = with lib; {
52 description = "Python library to work with devolo Home Control";
53 homepage = "https://github.com/2Fake/devolo_home_control_api";
54 license = with licenses; [ gpl3Only ];
55 maintainers = with maintainers; [ fab ];
56 };
57}