depot/third_party/nixpkgs/pkgs/development/python-modules/restrictedpython/default.nix
Default email 472aeafc57 Project import generated by Copybara.
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
2024-10-04 18:56:33 +02:00

43 lines
1,016 B
Nix

{
lib,
buildPythonPackage,
fetchPypi,
pytest-mock,
pytestCheckHook,
pythonAtLeast,
pythonOlder,
setuptools,
}:
buildPythonPackage rec {
pname = "restrictedpython";
version = "7.3";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchPypi {
pname = "RestrictedPython";
inherit version;
hash = "sha256-iIgwTHhY/c/YbFC1hWF5c3W6QDGdK2/7XSSwi2otzWE=";
};
build-system = [ setuptools ];
nativeCheckInputs = [
pytestCheckHook
pytest-mock
];
disabledTests = lib.optionals (pythonAtLeast "3.11") [ "test_compile__compile_restricted_exec__5" ];
pythonImportsCheck = [ "RestrictedPython" ];
meta = with lib; {
description = "Restricted execution environment for Python to run untrusted code";
homepage = "https://github.com/zopefoundation/RestrictedPython";
changelog = "https://github.com/zopefoundation/RestrictedPython/blob/${version}/CHANGES.rst";
license = licenses.zpl21;
maintainers = with maintainers; [ juaningan ];
};
}