diff options
author | Peter Hoeg <peter@hoeg.com> | 2020-01-09 10:50:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-09 10:50:17 +0800 |
commit | 0cffec3a7c69ddedbf6e7786fc1eb3d31ffa5f64 (patch) | |
tree | d072389b8ce80d5417418ac7a7690793ccf08262 /pkgs | |
parent | 1b28e47ae107ded7e2837787a376e5abb15152b5 (diff) | |
parent | 3f860eb736a37af60abb030383a4235c36238898 (diff) |
Merge pull request #70258 from juaningan/restrictedpython
home-assistant: add support for python_script component
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/development/python-modules/restrictedpython/default.nix | 34 | ||||
-rw-r--r-- | pkgs/servers/home-assistant/component-packages.nix | 2 | ||||
-rw-r--r-- | pkgs/top-level/python-packages.nix | 2 |
3 files changed, 37 insertions, 1 deletions
diff --git a/pkgs/development/python-modules/restrictedpython/default.nix b/pkgs/development/python-modules/restrictedpython/default.nix new file mode 100644 index 0000000000000..5163c7389b27e --- /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/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 492d5a0b0dc5c..c9278cd16e6fa 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; [ ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 760af1bcf078b..7cbae0956e79f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5131,6 +5131,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 { }; |