diff --git a/pkgs/development/python-modules/google-air-quality-api/default.nix b/pkgs/development/python-modules/google-air-quality-api/default.nix new file mode 100644 index 000000000000..a8125736d2da --- /dev/null +++ b/pkgs/development/python-modules/google-air-quality-api/default.nix @@ -0,0 +1,64 @@ +{ + lib, + aiohttp, + aioresponses, + buildPythonPackage, + fetchFromGitHub, + mashumaro, + poetry-core, + poetry-dynamic-versioning, + pytest-aiohttp, + pytest-asyncio, + pytest-cov-stub, + pytestCheckHook, + syrupy, + time-machine, +}: + +buildPythonPackage (finalAttrs: { + pname = "google-air-quality-api"; + version = "3.0.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "Thomas55555"; + repo = "python-google-air-quality-api"; + tag = finalAttrs.version; + hash = "sha256-hgdK7Rrw/iELRE+vSuwsRUzLDT8qE2Dhxqd4bAgxays="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail 'version = "0.0.0"' 'version = "${finalAttrs.version}"' + ''; + + build-system = [ + poetry-core + poetry-dynamic-versioning + ]; + + dependencies = [ + aiohttp + mashumaro + ]; + + nativeCheckInputs = [ + aioresponses + pytest-aiohttp + pytest-asyncio + pytest-cov-stub + pytestCheckHook + syrupy + time-machine + ]; + + pythonImportsCheck = [ "google_air_quality_api" ]; + + meta = { + changelog = "https://github.com/Thomas55555/python-google-air-quality-api/releases/tag/${finalAttrs.version}"; + description = "Python client library for the Google Air Quality API"; + homepage = "https://github.com/Thomas55555/python-google-air-quality-api"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.jamiemagee ]; + }; +}) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index d48e2b5ab5ca..2e95bf9acfee 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -2133,7 +2133,8 @@ ]; "google_air_quality" = ps: with ps; [ - ]; # missing inputs: google_air_quality_api + google-air-quality-api + ]; "google_assistant" = ps: with ps; [ aiohasupervisor @@ -7466,6 +7467,7 @@ "gogogate2" "goodwe" "google" + "google_air_quality" "google_assistant" "google_assistant_sdk" "google_cloud" diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 533eb60a3261..14abdf4f8c76 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6325,6 +6325,8 @@ self: super: with self; { callPackage ../development/python-modules/google-ai-generativelanguage { }; + google-air-quality-api = callPackage ../development/python-modules/google-air-quality-api { }; + google-api-core = callPackage ../development/python-modules/google-api-core { }; google-api-python-client = callPackage ../development/python-modules/google-api-python-client { };