From 5adccb42a165b80043019ec04977466327ad1f9d Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 10 Nov 2023 09:56:30 +0100 Subject: [PATCH] python311Packages.pytrydan: init at 0.4.0 Library to interface with V2C EVSE Trydan https://github.com/dgomes/pytrydan --- .../python-modules/pytrydan/default.nix | 66 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 68 insertions(+) create mode 100644 pkgs/development/python-modules/pytrydan/default.nix diff --git a/pkgs/development/python-modules/pytrydan/default.nix b/pkgs/development/python-modules/pytrydan/default.nix new file mode 100644 index 000000000000..ef54cf77b4f2 --- /dev/null +++ b/pkgs/development/python-modules/pytrydan/default.nix @@ -0,0 +1,66 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, httpx +, orjson +, poetry-core +, pytest-asyncio +, pytestCheckHook +, pythonOlder +, respx +, rich +, syrupy +, tenacity +, typer +}: + +buildPythonPackage rec { + pname = "pytrydan"; + version = "0.4.0"; + pyproject = true; + + disabled = pythonOlder "3.10"; + + src = fetchFromGitHub { + owner = "dgomes"; + repo = "pytrydan"; + rev = "refs/tags/v${version}"; + hash = "sha256-9PyRICtZ+0Ezinu28oFgFOSnOyCmD7zZbdc/chN+sCo="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace " --cov=pytrydan --cov-report=term-missing:skip-covered" "" + ''; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + httpx + orjson + rich + tenacity + typer + ]; + + nativeCheckInputs = [ + pytest-asyncio + pytestCheckHook + respx + syrupy + ]; + + pythonImportsCheck = [ + "pytrydan" + ]; + + meta = with lib; { + description = "Library to interface with V2C EVSE Trydan"; + homepage = "https://github.com/dgomes/pytrydan"; + changelog = "https://github.com/dgomes/pytrydan/blob/${version}/CHANGELOG.md"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c76f4ea814d6..a274d5dd8dce 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11674,6 +11674,8 @@ self: super: with self; { pytricia = callPackage ../development/python-modules/pytricia { }; + pytrydan = callPackage ../development/python-modules/pytrydan { }; + pyttsx3 = callPackage ../development/python-modules/pyttsx3 { }; pytube = callPackage ../development/python-modules/pytube { };