From 019cf935eb7beb9fe7d1ebfe271a9b03c0d8740a Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 24 Apr 2021 18:51:26 +0200 Subject: [PATCH 1/3] python3Packages.smhi-pkg: init at 1.0.14 --- .../python-modules/smhi-pkg/default.nix | 47 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 49 insertions(+) create mode 100644 pkgs/development/python-modules/smhi-pkg/default.nix diff --git a/pkgs/development/python-modules/smhi-pkg/default.nix b/pkgs/development/python-modules/smhi-pkg/default.nix new file mode 100644 index 00000000000..3308697cf54 --- /dev/null +++ b/pkgs/development/python-modules/smhi-pkg/default.nix @@ -0,0 +1,47 @@ +{ lib +, aiohttp +, buildPythonPackage +, fetchFromGitHub +, pytest-asyncio +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "smhi-pkg"; + version = "1.0.14"; + + src = fetchFromGitHub { + owner = "joysoftware"; + repo = "pypi_smhi"; + rev = version; + sha256 = "186xwrg3hvr0hszq2kxvygd241q2sp11gfk6mwj9z4zqywwfcbn3"; + }; + + propagatedBuildInputs = [ + aiohttp + ]; + + checkInputs = [ + pytest-asyncio + pytestCheckHook + ]; + + disabledTests = [ + # Disable tests that needs network access + "test_smhi_integration_test" + "test_smhi_async_integration_test" + "test_smhi_async_integration_test_use_session" + "test_smhi_async_get_forecast_integration2" + "test_async_error_from_api" + ]; + + pythonImportsCheck = [ "smhi" ]; + + meta = with lib; { + description = "Python library for accessing SMHI open forecast data"; + homepage = "https://github.com/joysoftware/pypi_smhi"; + changelog = "https://github.com/joysoftware/pypi_smhi/releases/tag/${version}"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ce472c130a0..96f22b7f986 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7997,6 +7997,8 @@ in { smdebug-rulesconfig = callPackage ../development/python-modules/smdebug-rulesconfig { }; + smhi-pkg = callPackage ../development/python-modules/smhi-pkg { }; + smmap2 = throw "smmap2 has been deprecated, use smmap instead."; # added 2020-03-14 smmap = callPackage ../development/python-modules/smmap { }; From cee055528dcef460c3d5e49eb147d9fd55675d4b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 24 Apr 2021 18:54:23 +0200 Subject: [PATCH 2/3] 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 9fa085816de..e972a7b5cd5 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -760,7 +760,7 @@ "smartthings" = ps: with ps; [ aiohttp-cors hass-nabucasa ]; # missing inputs: pysmartapp pysmartthings "smarttub" = ps: with ps; [ python-smarttub ]; "smarty" = ps: with ps; [ ]; # missing inputs: pysmarty - "smhi" = ps: with ps; [ ]; # missing inputs: smhi-pkg + "smhi" = ps: with ps; [ smhi-pkg ]; "sms" = ps: with ps; [ python-gammu ]; "smtp" = ps: with ps; [ ]; "snapcast" = ps: with ps; [ snapcast ]; From e1054f07f1c3fae9f8b96cb9d46cf75ddc27216f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 24 Apr 2021 18:54:51 +0200 Subject: [PATCH 3/3] home-assistant: enable smhi 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 f3f3efc8e6b..32fd0d31b11 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -356,6 +356,7 @@ in with py.pkgs; buildPythonApplication rec { "simulated" "sleepiq" "sma" + "smhi" "sensor" "slack" "smarttub"