Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / restrictedpython / default.nix
blob875771d8f8c6e8c2411d08076d6865abba9443e4
1 { lib
2 , buildPythonPackage
3 , fetchPypi
4 , pytest-mock
5 , pytestCheckHook
6 , pythonAtLeast
7 , pythonOlder
8 }:
10 buildPythonPackage rec {
11   pname = "restrictedpython";
12   version = "6.2";
13   format = "setuptools";
15   disabled = pythonOlder "3.7";
17   src = fetchPypi {
18     pname = "RestrictedPython";
19     inherit version;
20     hash = "sha256-23Prfjs5ZQ8NIdEMyN2pwOKYbmIclLDF3jL7De46CK8=";
21   };
23   nativeCheckInputs = [
24     pytestCheckHook
25     pytest-mock
26   ];
28   disabledTests = lib.optionals (pythonAtLeast "3.11") [
29     "test_compile__compile_restricted_exec__5"
30   ];
32   pythonImportsCheck = [
33     "RestrictedPython"
34   ];
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   };