From 8ffd0401466526d6d6bf2e280d57945e83f83c82 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 13 Jan 2021 18:57:03 +0100 Subject: [PATCH 1/2] python3Packages.pyopnsense: init at 0.3.0 --- .../python-modules/pyopnsense/default.nix | 45 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 47 insertions(+) create mode 100644 pkgs/development/python-modules/pyopnsense/default.nix diff --git a/pkgs/development/python-modules/pyopnsense/default.nix b/pkgs/development/python-modules/pyopnsense/default.nix new file mode 100644 index 000000000000..f4f5bf6c70d4 --- /dev/null +++ b/pkgs/development/python-modules/pyopnsense/default.nix @@ -0,0 +1,45 @@ +{ lib +, buildPythonPackage +, fetchPypi +, fixtures +, mock +, pbr +, pytest-cov +, pytestCheckHook +, pythonOlder +, requests +, six +}: + +buildPythonPackage rec { + pname = "pyopnsense"; + version = "0.3.0"; + disabled = pythonOlder "3.7"; + + src = fetchPypi { + inherit pname version; + sha256 = "06rssdb3zhccnm63z96mw5yd38d9i99fgigfcdxn9divalbbhp5a"; + }; + + propagatedBuildInputs = [ + pbr + six + requests + ]; + + checkInputs = [ + fixtures + mock + pytest-cov + pytestCheckHook + ]; + + pythonImportsCheck = [ "pyopnsense" ]; + + meta = with lib; { + description = "Python client for the OPNsense API"; + homepage = "https://github.com/mtreinish/pyopnsense"; + license = with licenses; [ gpl3Plus ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4c738a3cef9a..aa636fce3ddc 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5583,6 +5583,8 @@ in { pyopenssl = callPackage ../development/python-modules/pyopenssl { }; + pyopnsense = callPackage ../development/python-modules/pyopnsense { }; + pyosf = callPackage ../development/python-modules/pyosf { }; pyosmium = callPackage ../development/python-modules/pyosmium { }; From 80ee2d95437f8e389ec4cdb0f8e4aa8e28e8aa59 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 13 Jan 2021 18:57:25 +0100 Subject: [PATCH 2/2] 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 8404d6645e5a..3f17ae7bebdc 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -590,7 +590,7 @@ "opentherm_gw" = ps: with ps; [ ]; # missing inputs: pyotgw "openuv" = ps: with ps; [ ]; # missing inputs: pyopenuv "openweathermap" = ps: with ps; [ pyowm ]; - "opnsense" = ps: with ps; [ ]; # missing inputs: pyopnsense + "opnsense" = ps: with ps; [ pyopnsense ]; "opple" = ps: with ps; [ ]; # missing inputs: pyoppleio "orangepi_gpio" = ps: with ps; [ ]; # missing inputs: OPi.GPIO "oru" = ps: with ps; [ ]; # missing inputs: oru