1{ lib 2, buildPythonPackage 3, fetchPypi 4, pytest-mock 5, pytestCheckHook 6, pythonAtLeast 7, pythonOlder 8}: 9 10buildPythonPackage rec { 11 pname = "restrictedpython"; 12 version = "6.2"; 13 format = "setuptools"; 14 15 disabled = pythonOlder "3.7"; 16 17 src = fetchPypi { 18 pname = "RestrictedPython"; 19 inherit version; 20 hash = "sha256-23Prfjs5ZQ8NIdEMyN2pwOKYbmIclLDF3jL7De46CK8="; 21 }; 22 23 nativeCheckInputs = [ 24 pytestCheckHook 25 pytest-mock 26 ]; 27 28 disabledTests = lib.optionals (pythonAtLeast "3.11") [ 29 "test_compile__compile_restricted_exec__5" 30 ]; 31 32 pythonImportsCheck = [ 33 "RestrictedPython" 34 ]; 35 36 meta = with lib; { 37 description = "Restricted execution environment for Python to run untrusted code"; 38 homepage = "https://github.com/zopefoundation/RestrictedPython"; 39 changelog = "https://github.com/zopefoundation/RestrictedPython/blob/${version}/CHANGES.rst"; 40 license = licenses.zpl21; 41 maintainers = with maintainers; [ juaningan ]; 42 }; 43}