summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/zope-security/default.nix
blob: ca25a0f0ed76c0932b2877e8c4a8d5b9c31dfd1e (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  zope-component,
  zope-i18nmessageid,
  zope-interface,
  zope-location,
  zope-proxy,
  zope-schema,
  pytz,
  zope-configuration,
  btrees,
  unittestCheckHook,
  zope-exceptions,
}:

buildPythonPackage rec {
  pname = "zope-security";
  version = "7.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "zopefoundation";
    repo = "zope.security";
    tag = version;
    hash = "sha256-p+9pCcBsCJY/V6vraVZHMr5VwYHFe217AbRVoSnDphs=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail "setuptools<74" "setuptools"
  '';

  build-system = [ setuptools ];

  dependencies = [
    zope-component
    zope-i18nmessageid
    zope-interface
    zope-location
    zope-proxy
    zope-schema
  ];

  optional-dependencies = {
    pytz = [ pytz ];
    # untrustedpython = [ zope-untrustedpython ];
    zcml = [ zope-configuration ];
  };

  pythonImportsCheck = [ "zope.security" ];

  nativeCheckInputs = [
    btrees
    unittestCheckHook
    zope-exceptions
  ];

  # Import process is too complex and some tests fail
  preCheck = ''
    rm -r src/zope/security/tests/test_metaconfigure.py
    rm -r src/zope/security/tests/test_proxy.py
    rm -r src/zope/security/tests/test_zcml_functest.py
  '';

  unittestFlagsArray = [ "src/zope/security/tests" ];

  pythonNamespaces = [ "zope" ];

  meta = {
    description = "Zope Security Framework";
    homepage = "https://github.com/zopefoundation/zope.security";
    changelog = "https://github.com/zopefoundation/zope.security/blob/${src.tag}/CHANGES.rst";
    license = lib.licenses.zpl21;
    maintainers = with lib.maintainers; [ ];
  };
}