about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/homematicip/default.nix
blob: 4de61606e0c6c21de1669273a13a78b52c5f5edb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{ lib
, aenum
, aiohttp
, aiohttp-wsgi
, async-timeout
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, pytest_7
, pythonAtLeast
, pythonOlder
, pytest-aiohttp
, pytest-asyncio
, requests
, setuptools
, setuptools-scm
, websocket-client
, websockets
}:

buildPythonPackage rec {
  pname = "homematicip";
  version = "1.1.0";
  pyproject = true;

  disabled = pythonOlder "3.10";

  src = fetchFromGitHub {
    owner = "hahn-th";
    repo = "homematicip-rest-api";
    rev = "refs/tags/${version}";
    hash = "sha256-tx7/amXG3rLdUFgRPQcuf57qkBLAPxPWjLGSO7MrcWU=";
  };

  nativeBuildInputs = [
    setuptools
    setuptools-scm
  ];

  propagatedBuildInputs = [
    aenum
    aiohttp
    async-timeout
    requests
    websocket-client
    websockets
  ];

  nativeCheckInputs = [
    aiohttp-wsgi
    pytest-aiohttp
    pytest-asyncio
    (pytestCheckHook.override { pytest = pytest_7; })
  ];

  pytestFlagsArray = [
    "--asyncio-mode=auto"
  ];

  disabledTests = [
    # Assert issues with datetime
    "test_contact_interface_device"
    "test_dimmer"
    "test_external_device"
    "test_heating_failure_alert_group"
    "test_heating"
    "test_humidity_warning_rule_group"
    "test_meta_group"
    "test_pluggable_switch_measuring"
    "test_rotary_handle_sensor"
    "test_security_group"
    "test_security_zone"
    "test_shutter_device"
    "test_smoke_detector"
    "test_switching_group"
    "test_temperature_humidity_sensor_outdoor"
    "test_wall_mounted_thermostat_pro"
    "test_weather_sensor"
    # Random failures
    "test_home_getSecurityJournal"
    "test_home_unknown_types"
    # Requires network access
    "test_websocket"
  ] ++ lib.optionals (pythonAtLeast "3.10") [
    "test_connection_lost"
    "test_user_disconnect_and_reconnect"
    "test_ws_message"
    "test_ws_no_pong"
  ];

  pythonImportsCheck = [
    "homematicip"
  ];

  meta = with lib; {
    description = "Module for the homematicIP REST API";
    homepage = "https://github.com/hahn-th/homematicip-rest-api";
    changelog = "https://github.com/hahn-th/homematicip-rest-api/releases/tag/${version}";
    license = with licenses; [ gpl3Only ];
    maintainers = with maintainers; [ fab ];
  };
}