From 7a08ed05f64a4ce14dfcf7c8a4f8db507a5d07a4 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 25 Sep 2021 10:07:13 +0200 Subject: [PATCH 1/4] python3Packages.marshmallow-dataclass: init at 8.5.3 --- .../marshmallow-dataclass/default.nix | 45 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 47 insertions(+) create mode 100644 pkgs/development/python-modules/marshmallow-dataclass/default.nix diff --git a/pkgs/development/python-modules/marshmallow-dataclass/default.nix b/pkgs/development/python-modules/marshmallow-dataclass/default.nix new file mode 100644 index 000000000000..145005fd5e39 --- /dev/null +++ b/pkgs/development/python-modules/marshmallow-dataclass/default.nix @@ -0,0 +1,45 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, marshmallow +, marshmallow-enum +, pytestCheckHook +, pythonOlder +, typeguard +, typing-inspect +}: + +buildPythonPackage rec { + pname = "marshmallow-dataclass"; + version = "8.5.3"; + format = "setuptools"; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "lovasoa"; + repo = "marshmallow_dataclass"; + rev = "v${version}"; + sha256 = "0mngkjfs2nxxr0y77n429hb22rmjxbnn95j4vwqr9y6q16bqxs0w"; + }; + + propagatedBuildInputs = [ + marshmallow + typing-inspect + ]; + + checkInputs = [ + marshmallow-enum + pytestCheckHook + typeguard + ]; + + pythonImportsCheck = [ "marshmallow_dataclass" ]; + + meta = with lib; { + description = "Automatic generation of marshmallow schemas from dataclasses"; + homepage = "https://github.com/lovasoa/marshmallow_dataclass"; + 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 50803af17df7..55e192dc86f3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4464,6 +4464,8 @@ in { marshmallow = callPackage ../development/python-modules/marshmallow { }; + marshmallow-dataclass = callPackage ../development/python-modules/marshmallow-dataclass { }; + marshmallow-enum = callPackage ../development/python-modules/marshmallow-enum { }; marshmallow-oneofschema = callPackage ../development/python-modules/marshmallow-oneofschema { }; From f6ce10aac7c645f637997412c193eaea323499a9 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 25 Sep 2021 10:11:24 +0200 Subject: [PATCH 2/4] python3Packages.renault-api: init at 0.1.4 --- .../python-modules/renault-api/default.nix | 68 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 70 insertions(+) create mode 100644 pkgs/development/python-modules/renault-api/default.nix diff --git a/pkgs/development/python-modules/renault-api/default.nix b/pkgs/development/python-modules/renault-api/default.nix new file mode 100644 index 000000000000..9508a86e33b6 --- /dev/null +++ b/pkgs/development/python-modules/renault-api/default.nix @@ -0,0 +1,68 @@ +{ lib +, aiohttp +, aioresponses +, buildPythonPackage +, click +, dateparser +, fetchFromGitHub +, fetchpatch +, marshmallow-dataclass +, poetry-core +, pyjwt +, pythonOlder +, pytest-asyncio +, pytestCheckHook +, tabulate +}: + +buildPythonPackage rec { + pname = "renault-api"; + version = "0.1.4"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "hacf-fr"; + repo = pname; + rev = "v${version}"; + sha256 = "049kh63yk0r0falqbl5akcwgzqjrkqqhf9y537rrlzc85ihf28b8"; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + aiohttp + click + dateparser + marshmallow-dataclass + pyjwt + tabulate + ]; + + checkInputs = [ + aioresponses + pytest-asyncio + pytestCheckHook + ]; + + patches = [ + # Switch to poetry-core, https://github.com/hacf-fr/renault-api/pull/371 + (fetchpatch { + name = "switch-to-poetry-core.patch"; + url = "https://github.com/hacf-fr/renault-api/commit/5457a612b9ff9f323e8449cbe9dbce465bd65a79.patch"; + sha256 = "0ds9m4j2qpv0nyg9p8dk9klnarl8wckwclddgnii6h47qci362yy"; + }) + ]; + + pythonImportsCheck = [ "renault_api" ]; + + meta = with lib; { + description = "Python library to interact with the Renault API"; + homepage = "https://github.com/hacf-fr/renault-api"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 55e192dc86f3..2b016095095a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7799,6 +7799,8 @@ in { remarshal = callPackage ../development/python-modules/remarshal { }; + renault-api = callPackage ../development/python-modules/renault-api { }; + rencode = callPackage ../development/python-modules/rencode { }; reparser = callPackage ../development/python-modules/reparser { }; From 9aa02e78e14a0ff1994574c50377184abf7237ab Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 25 Sep 2021 10:12:19 +0200 Subject: [PATCH 3/4] home-assistant: update component-packages --- pkgs/servers/home-assistant/component-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index b1363880f9f8..c9e605c96fd0 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -703,7 +703,7 @@ "remember_the_milk" = ps: with ps; [ httplib2 ]; # missing inputs: RtmAPI "remote" = ps: with ps; [ ]; "remote_rpi_gpio" = ps: with ps; [ ]; # missing inputs: gpiozero - "renault" = ps: with ps; [ ]; # missing inputs: renault-api + "renault" = ps: with ps; [ renault-api ]; "repetier" = ps: with ps; [ ]; # missing inputs: pyrepetier "rest" = ps: with ps; [ jsonpath xmltodict ]; "rest_command" = ps: with ps; [ ]; From b9317c9ed1c9261e3fbde8d16fac60ec665b02e5 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 25 Sep 2021 10:13:42 +0200 Subject: [PATCH 4/4] home-assistant: enable renault tests --- pkgs/servers/home-assistant/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 27c34e10e382..07a0e47b6034 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -575,6 +575,7 @@ in with py.pkgs; buildPythonApplication rec { "recorder" "reddit" "remote" + "renault" "rest" "rest_command" "rflink"