From 677873bbaa31d036be46a858cd45ed3675ce3c44 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 18 Jan 2024 15:22:56 +0100 Subject: [PATCH] python311Packages.pyosohotwaterapi: init at 1.1.4 Module for using the OSO Hotwater API https://github.com/osohotwateriot/apyosohotwaterapi --- .../pyosohotwaterapi/default.nix | 63 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 65 insertions(+) create mode 100644 pkgs/development/python-modules/pyosohotwaterapi/default.nix diff --git a/pkgs/development/python-modules/pyosohotwaterapi/default.nix b/pkgs/development/python-modules/pyosohotwaterapi/default.nix new file mode 100644 index 000000000000..bd2b10976a07 --- /dev/null +++ b/pkgs/development/python-modules/pyosohotwaterapi/default.nix @@ -0,0 +1,63 @@ +{ lib +, aiohttp +, buildPythonPackage +, fetchFromGitHub +, loguru +, numpy +, pythonOlder +, setuptools +, unasync +, urllib3 +}: + +buildPythonPackage rec { + pname = "pyosohotwaterapi"; + version = "1.1.4"; + pyproject = true; + + disabled = pythonOlder "3.10"; + + src = fetchFromGitHub { + owner = "osohotwateriot"; + repo = "apyosohotwaterapi"; + rev = "refs/tags/${version}"; + hash = "sha256-7FLGmmndrFqSl4oC8QFIYNlFJPr+xbiZG5ZRt4vx8+s="; + }; + + postPatch = '' + # https://github.com/osohotwateriot/apyosohotwaterapi/pull/3 + substituteInPlace requirements.txt \ + --replace "pre-commit" "" + ''; + + nativeBuildInputs = [ + setuptools + unasync + ]; + + propagatedBuildInputs = [ + aiohttp + loguru + numpy + urllib3 + ]; + + preBuild = '' + export HOME=$(mktemp -d) + ''; + + # Module has no tests + doCheck = false; + + pythonImportsCheck = [ + "apyosoenergyapi" + ]; + + meta = with lib; { + description = "Module for using the OSO Hotwater API"; + homepage = "https://github.com/osohotwateriot/apyosohotwaterapi"; + changelog = "https://github.com/osohotwateriot/apyosohotwaterapi/releases/tag/${version}"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 314fd3f8ff8f..3ff5dde0e10d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10928,6 +10928,8 @@ self: super: with self; { inherit (pkgs) lz4; }; + pyosohotwaterapi = callPackage ../development/python-modules/pyosohotwaterapi { }; + pyotgw = callPackage ../development/python-modules/pyotgw { }; pyotp = callPackage ../development/python-modules/pyotp { };