From b984c72b06711776751372d58a29806e2f535a2b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 12 Feb 2021 19:21:47 +0100 Subject: [PATCH 1/2] python3Packages.pyairnow: init at 1.1.0 --- .../python-modules/pyairnow/default.nix | 45 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 47 insertions(+) create mode 100644 pkgs/development/python-modules/pyairnow/default.nix diff --git a/pkgs/development/python-modules/pyairnow/default.nix b/pkgs/development/python-modules/pyairnow/default.nix new file mode 100644 index 000000000000..51497e8875b7 --- /dev/null +++ b/pkgs/development/python-modules/pyairnow/default.nix @@ -0,0 +1,45 @@ +{ lib +, aiohttp +, aioresponses +, buildPythonPackage +, fetchFromGitHub +, pytest-aiohttp +, poetry +, pytest-asyncio +, pytest-cov +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "pyairnow"; + version = "1.1.0"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "asymworks"; + repo = pname; + rev = "v${version}"; + sha256 = "1hkpfl8rdwyzqrr1drqlmcw3xpv3pi1jf19h1divspbzwarqxs1c"; + }; + + nativeBuildInputs = [ poetry ]; + + propagatedBuildInputs = [ aiohttp ]; + + checkInputs = [ + aioresponses + pytest-asyncio + pytest-aiohttp + pytest-cov + pytestCheckHook + ]; + + pythonImportsCheck = [ "pyairnow" ]; + + meta = with lib; { + description = "Python wrapper for EPA AirNow Air Quality API"; + homepage = "https://github.com/asymworks/pyairnow"; + 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 08b8cb846756..a6c85175c5fb 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5195,6 +5195,8 @@ in { pyahocorasick = callPackage ../development/python-modules/pyahocorasick { }; + pyairnow = callPackage ../development/python-modules/pyairnow { }; + pyairvisual = callPackage ../development/python-modules/pyairvisual { }; pyalgotrade = callPackage ../development/python-modules/pyalgotrade { }; From 30fc4f03d2da7ea5199979828c207cf6a6ca6b88 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 12 Feb 2021 19:22:35 +0100 Subject: [PATCH 2/2] 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 2f97cb4a9684..2d5ced3b5cb6 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -16,7 +16,7 @@ "agent_dvr" = ps: with ps; [ agent-py ]; "air_quality" = ps: with ps; [ ]; "airly" = ps: with ps; [ airly ]; - "airnow" = ps: with ps; [ ]; # missing inputs: pyairnow + "airnow" = ps: with ps; [ pyairnow ]; "airvisual" = ps: with ps; [ pyairvisual ]; "aladdin_connect" = ps: with ps; [ ]; # missing inputs: aladdin_connect "alarm_control_panel" = ps: with ps; [ ];