From 88d04db27935188d0264fac886baf1f10044450a Mon Sep 17 00:00:00 2001 From: Juanjo Presa Date: Wed, 2 Oct 2019 16:03:04 +0100 Subject: [PATCH 1/2] python3Packages.restrictedpython: init at 5.0 --- .../restrictedpython/default.nix | 34 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/development/python-modules/restrictedpython/default.nix diff --git a/pkgs/development/python-modules/restrictedpython/default.nix b/pkgs/development/python-modules/restrictedpython/default.nix new file mode 100644 index 000000000000..5163c7389b27 --- /dev/null +++ b/pkgs/development/python-modules/restrictedpython/default.nix @@ -0,0 +1,34 @@ +{ lib +, buildPythonPackage +, fetchPypi + +# Test dependencies +, pytest, pytest-mock +}: + +buildPythonPackage rec { + pname = "RestrictedPython"; + version = "5.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "1g0sffn6ifkl1w8gq15rpaqm8c7l68bsnm77wcd3flyzzydmd050"; + }; + + #propagatedBuildInputs = [ xmltodict requests ifaddr ]; + + checkInputs = [ + pytest pytest-mock + ]; + + checkPhase = '' + pytest + ''; + + meta = { + homepage = https://github.com/zopefoundation/RestrictedPython; + description = "A restricted execution environment for Python to run untrusted code"; + license = lib.licenses.zpl21; + maintainers = with lib.maintainers; [ juaningan ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f61ca230c075..d9afeb557645 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4864,6 +4864,8 @@ in { repocheck = callPackage ../development/python-modules/repocheck { }; + restrictedpython = callPackage ../development/python-modules/restrictedpython { }; + restview = callPackage ../development/python-modules/restview { }; readme = callPackage ../development/python-modules/readme { }; From 3f860eb736a37af60abb030383a4235c36238898 Mon Sep 17 00:00:00 2001 From: Juanjo Presa Date: Wed, 2 Oct 2019 16:02:14 +0100 Subject: [PATCH 2/2] home-assistant: run parse-requirements.py home-assistant: run parse-requirements.py --- pkgs/servers/home-assistant/component-packages.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index f46868c4cb42..ddc6b62bdc3a 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -583,7 +583,7 @@ "pushsafer" = ps: with ps; [ ]; "pvoutput" = ps: with ps; [ ]; "pyload" = ps: with ps; [ ]; - "python_script" = ps: with ps; [ ]; + "python_script" = ps: with ps; [ restrictedpython ]; "qbittorrent" = ps: with ps; [ ]; "qld_bushfire" = ps: with ps; [ ]; "qnap" = ps: with ps; [ ]; @@ -814,7 +814,7 @@ "vicare" = ps: with ps; [ ]; "vivotek" = ps: with ps; [ ]; "vizio" = ps: with ps; [ ]; - "vlc" = ps: with ps; [ ]; + "vlc" = ps: with ps; [ python-vlc ]; "vlc_telnet" = ps: with ps; [ ]; "voicerss" = ps: with ps; [ ]; "volkszaehler" = ps: with ps; [ ];