nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytest-mock,
6 pytestCheckHook,
7 setuptools,
8}:
9
10buildPythonPackage rec {
11 pname = "restrictedpython";
12 version = "8.1";
13 pyproject = true;
14
15 src = fetchFromGitHub {
16 owner = "zopefoundation";
17 repo = "RestrictedPython";
18 tag = version;
19 hash = "sha256-UcmH1I2p+XmQm4Y5M+Ms/LMSchor6GD6V9dxippa4HI=";
20 };
21
22 postPatch = ''
23 substituteInPlace pyproject.toml \
24 --replace-fail "setuptools >= 78.1.1,< 81" setuptools
25 '';
26
27 build-system = [ setuptools ];
28
29 nativeCheckInputs = [
30 pytestCheckHook
31 pytest-mock
32 ];
33
34 pythonImportsCheck = [ "RestrictedPython" ];
35
36 meta = {
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/${src.tag}/CHANGES.rst";
40 license = lib.licenses.zpl21;
41 maintainers = with lib.maintainers; [ juaningan ];
42 };
43}