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/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/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 1b1ef4eea1e9..001f96e2ed94 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; [ ]; diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index aec31de177b2..e1ecc1323bb7 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -576,6 +576,7 @@ in with py.pkgs; buildPythonApplication rec { "recorder" "reddit" "remote" + "renault" "rest" "rest_command" "rflink" diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1d363088ed8b..fcb1b771d5b3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4472,6 +4472,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 { }; @@ -7809,6 +7811,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 { };