{ lib, buildPythonPackage, fetchFromGitHub, pytest-mock, pytestCheckHook, setuptools, }: buildPythonPackage rec { pname = "restrictedpython"; version = "8.1"; pyproject = true; src = fetchFromGitHub { owner = "zopefoundation"; repo = "RestrictedPython"; tag = version; hash = "sha256-UcmH1I2p+XmQm4Y5M+Ms/LMSchor6GD6V9dxippa4HI="; }; postPatch = '' substituteInPlace pyproject.toml \ --replace-fail "setuptools >= 78.1.1,< 81" setuptools ''; build-system = [ setuptools ]; nativeCheckInputs = [ pytestCheckHook pytest-mock ]; pythonImportsCheck = [ "RestrictedPython" ]; meta = { description = "Restricted execution environment for Python to run untrusted code"; homepage = "https://github.com/zopefoundation/RestrictedPython"; changelog = "https://github.com/zopefoundation/RestrictedPython/blob/${src.tag}/CHANGES.rst"; license = lib.licenses.zpl21; maintainers = with lib.maintainers; [ juaningan ]; }; }