From c197fdd49802e54a84bd69a5e00c83883e83c13f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 9 Apr 2021 23:44:02 +0200 Subject: [PATCH 1/4] python3Packages.aiohttp-wsgi: init at 0.8.2 --- .../python-modules/aiohttp-wsgi/default.nix | 37 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 39 insertions(+) create mode 100644 pkgs/development/python-modules/aiohttp-wsgi/default.nix diff --git a/pkgs/development/python-modules/aiohttp-wsgi/default.nix b/pkgs/development/python-modules/aiohttp-wsgi/default.nix new file mode 100644 index 000000000000..25264a665271 --- /dev/null +++ b/pkgs/development/python-modules/aiohttp-wsgi/default.nix @@ -0,0 +1,37 @@ +{ lib +, aiohttp +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "aiohttp-wsgi"; + version = "0.8.2"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "etianen"; + repo = pname; + rev = version; + sha256 = "0wirn3xqxxgkpy5spicd7p1bkdnsrch61x2kcpdwpixmx961pq7x"; + }; + + propagatedBuildInputs = [ + aiohttp + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "aiohttp_wsgi" ]; + + meta = with lib; { + description = "WSGI adapter for aiohttp"; + homepage = "https://github.com/etianen/aiohttp-wsgi"; + license = with licenses; [ bsd3 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9010d78e57c6..953656e7f8b9 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -276,6 +276,8 @@ in { aiohttp-swagger = callPackage ../development/python-modules/aiohttp-swagger { }; + aiohttp-wsgi = callPackage ../development/python-modules/aiohttp-wsgi { }; + aioitertools = callPackage ../development/python-modules/aioitertools { }; aiobotocore = callPackage ../development/python-modules/aiobotocore { }; From 7564d5ef16fd87e13b225ff8a0f0501889359435 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 10 Apr 2021 00:21:45 +0200 Subject: [PATCH 2/4] python3Packages.homematicip: init at 1.0.0 --- .../python-modules/homematicip/default.nix | 77 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 79 insertions(+) create mode 100644 pkgs/development/python-modules/homematicip/default.nix diff --git a/pkgs/development/python-modules/homematicip/default.nix b/pkgs/development/python-modules/homematicip/default.nix new file mode 100644 index 000000000000..b2d6da18fe74 --- /dev/null +++ b/pkgs/development/python-modules/homematicip/default.nix @@ -0,0 +1,77 @@ +{ lib +, aenum +, aiohttp +, aiohttp-wsgi +, async-timeout +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, pythonOlder +, pytest-aiohttp +, pytest-asyncio +, requests +, websocket_client +, websockets +}: + +buildPythonPackage rec { + pname = "homematicip"; + version = "1.0.0"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "coreGreenberet"; + repo = "homematicip-rest-api"; + rev = version; + sha256 = "0bgvrjcf10kiqqkbl56sxx3jydd722b08q2j9c8sxpk0qdrmrinv"; + }; + + propagatedBuildInputs = [ + aenum + aiohttp + async-timeout + requests + websocket_client + websockets + ]; + + checkInputs = [ + aiohttp-wsgi + pytest-aiohttp + pytest-asyncio + pytestCheckHook + ]; + + disabledTests = [ + # Assert issues with datetime + "test_contact_interface_device" + "test_dimmer" + "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_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" + ]; + + pythonImportsCheck = [ "homematicip" ]; + + meta = with lib; { + description = "Python module for the homematicIP REST API"; + homepage = "https://github.com/coreGreenberet/homematicip-rest-api"; + license = with licenses; [ gpl3Only ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 953656e7f8b9..1f6a1a603a10 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3126,6 +3126,8 @@ in { homeassistant-pyozw = callPackage ../development/python-modules/homeassistant-pyozw { }; + homematicip = callPackage ../development/python-modules/homematicip { }; + homepluscontrol = callPackage ../development/python-modules/homepluscontrol { }; hoomd-blue = toPythonModule (callPackage ../development/python-modules/hoomd-blue { From a71daddb5d01f2f5eaee28e5cfc8a833fb6c2375 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 10 Apr 2021 00:04:06 +0200 Subject: [PATCH 3/4] home-assistant: update component-packages --- pkgs/servers/home-assistant/component-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 5b7d21a16bfc..900f58d418bb 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -357,7 +357,7 @@ "homekit" = ps: with ps; [ HAP-python pyqrcode pyturbojpeg aiohttp-cors base36 fnvhash ha-ffmpeg zeroconf ]; "homekit_controller" = ps: with ps; [ aiohomekit aiohttp-cors zeroconf ]; "homematic" = ps: with ps; [ pyhomematic ]; - "homematicip_cloud" = ps: with ps; [ ]; # missing inputs: homematicip + "homematicip_cloud" = ps: with ps; [ homematicip ]; "homeworks" = ps: with ps; [ ]; # missing inputs: pyhomeworks "honeywell" = ps: with ps; [ ]; # missing inputs: somecomfort "horizon" = ps: with ps; [ ]; # missing inputs: horimote From 793d6714099dff153674fe716daed28cf8ba228f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 10 Apr 2021 00:05:09 +0200 Subject: [PATCH 4/4] home-assistant: enable homematicip_cloud tests --- pkgs/servers/home-assistant/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index c2987c19e6f1..af0e4e8b9f8d 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -241,6 +241,7 @@ in with py.pkgs; buildPythonApplication rec { "homekit_controller" "homeassistant" "homematic" + "homematicip_cloud" "html5" "http" "hue"