From e8c5fbd650031250e3a56355822c0c0ef7ac6953 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 4 Jan 2023 23:01:52 +0100 Subject: [PATCH 1/2] python310Packages.aiopurpleair: init at 2022.12.1 --- .../python-modules/aiopurpleair/default.nix | 65 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 67 insertions(+) create mode 100644 pkgs/development/python-modules/aiopurpleair/default.nix diff --git a/pkgs/development/python-modules/aiopurpleair/default.nix b/pkgs/development/python-modules/aiopurpleair/default.nix new file mode 100644 index 000000000000..fce3b9f4d0cd --- /dev/null +++ b/pkgs/development/python-modules/aiopurpleair/default.nix @@ -0,0 +1,65 @@ +{ lib +, aiohttp +, aresponses +, buildPythonPackage +, fetchFromGitHub +, poetry-core +, pydantic +, pytest-aiohttp +, pytest-asyncio +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "aiopurpleair"; + version = "2022.12.1"; + format = "pyproject"; + + disabled = pythonOlder "3.9"; + + src = fetchFromGitHub { + owner = "bachya"; + repo = pname; + rev = "refs/tags/${version}"; + hash = "sha256-YmJH4brWkTpgzyHwu9UnIWrY5qlDCmMtvF+KxQFXwfk="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace 'pydantic = "^1.10.2"' 'pydantic = "*"' + ''; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + aiohttp + pydantic + ]; + + checkInputs = [ + aresponses + pytest-aiohttp + pytest-asyncio + pytestCheckHook + ]; + + disabledTestPaths = [ + # Ignore the examples directory as the files are prefixed with test_. + "examples/" + ]; + + pythonImportsCheck = [ + "aiopurpleair" + ]; + + meta = with lib; { + description = "Python library for interacting with the PurpleAir API"; + homepage = "https://github.com/bachya/aiopurpleair"; + changelog = "https://github.com/bachya/aiopurpleair/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 c07ff886535e..1093377fe44f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -278,6 +278,8 @@ self: super: with self; { aiopulse = callPackage ../development/python-modules/aiopulse { }; + aiopurpleair = callPackage ../development/python-modules/aiopurpleair { }; + aiopvapi = callPackage ../development/python-modules/aiopvapi { }; aiopvpc = callPackage ../development/python-modules/aiopvpc { }; From 426f025e78ff9dfcba3d6a7f0a274ba82878fecc Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 5 Jan 2023 20:50:23 +0100 Subject: [PATCH 2/2] home-assistant: update component-packages --- pkgs/servers/home-assistant/component-packages.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index dee4a13077ac..eff6b8916943 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -2674,7 +2674,8 @@ gridnet ]; "purpleair" = ps: with ps; [ - ]; # missing inputs: aiopurpleair + aiopurpleair + ]; "push" = ps: with ps; [ aiohttp-cors ]; @@ -4551,6 +4552,7 @@ "proximity" "prusalink" "pure_energie" + "purpleair" "push" "pushbullet" "pushover"