From 31bcaf75e8e9e098356660d545c8509787a45657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 3 Oct 2024 16:49:31 -0700 Subject: [PATCH] python312Packages.lektricowifi: init at 0.0.43 --- .../python-modules/lektricowifi/default.nix | 58 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 60 insertions(+) create mode 100644 pkgs/development/python-modules/lektricowifi/default.nix diff --git a/pkgs/development/python-modules/lektricowifi/default.nix b/pkgs/development/python-modules/lektricowifi/default.nix new file mode 100644 index 000000000000..b6b4a5142c3c --- /dev/null +++ b/pkgs/development/python-modules/lektricowifi/default.nix @@ -0,0 +1,58 @@ +{ + async-timeout, + buildPythonPackage, + fetchFromGitHub, + httpx, + lib, + pydantic, + pytest-asyncio, + pytestCheckHook, + setuptools, +}: + +buildPythonPackage rec { + pname = "lektricowifi"; + version = "0.0.43"; + pyproject = true; + + src = fetchFromGitHub { + owner = "Lektrico"; + repo = "lektricowifi"; + rev = "refs/tags/v.${version}"; + hash = "sha256-NwM1WpH6tS0iAVpG2gSFJpDPPn9nECHAzpOnWzeYPH4="; + }; + + postPatch = '' + substituteInPlace tests/test_mocked_devices.py \ + --replace-fail "from asyncmock import AsyncMock" "from unittest.mock import AsyncMock" + ''; + + build-system = [ setuptools ]; + + pythonRelaxDeps = [ + "pydantic" + ]; + + dependencies = [ + async-timeout + httpx + pydantic + ]; + + pythonImportsCheck = [ "lektricowifi" ]; + + nativeCheckInputs = [ + pytest-asyncio + pytestCheckHook + ]; + + # AttributeError: type object 'InfoForCharger' has no attribute 'from_dict' + doCheck = false; + + meta = { + description = "Communication with Lektrico's chargers"; + homepage = "https://github.com/Lektrico/lektricowifi"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b5a9648c6a34..9ae98146679c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6991,6 +6991,8 @@ self: super: with self; { igraph-c = pkgs.igraph; }; + lektricowifi = callPackage ../development/python-modules/lektricowifi { }; + leveldb = callPackage ../development/python-modules/leveldb { }; levenshtein = callPackage ../development/python-modules/levenshtein { };