2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2021-12-06 16:07:01 +00:00
|
|
|
, pytest-mock
|
|
|
|
, pytestCheckHook
|
2023-07-15 17:15:38 +00:00
|
|
|
, pythonAtLeast
|
2023-01-11 07:51:40 +00:00
|
|
|
, pythonOlder
|
2024-01-02 11:29:13 +00:00
|
|
|
, setuptools
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "restrictedpython";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "7.1";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchPypi {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "RestrictedPython";
|
|
|
|
inherit version;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-h1rrUcE51440zvhgXcZTCbRJFoBg3QhVGh/p7bR8uaU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-mock
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
disabledTests = lib.optionals (pythonAtLeast "3.11") [
|
|
|
|
"test_compile__compile_restricted_exec__5"
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"RestrictedPython"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Restricted execution environment for Python to run untrusted code";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/zopefoundation/RestrictedPython";
|
2023-01-11 07:51:40 +00:00
|
|
|
changelog = "https://github.com/zopefoundation/RestrictedPython/blob/${version}/CHANGES.rst";
|
2021-12-06 16:07:01 +00:00
|
|
|
license = licenses.zpl21;
|
|
|
|
maintainers = with maintainers; [ juaningan ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|