1{
2 lib,
3 buildPythonPackage,
4 cryptography,
5 defusedxml,
6 fetchFromGitHub,
7 paste,
8 poetry-core,
9 pyasn1,
10 pymongo,
11 pyopenssl,
12 pytestCheckHook,
13 python-dateutil,
14 pythonOlder,
15 pytz,
16 repoze-who,
17 requests,
18 responses,
19 setuptools,
20 substituteAll,
21 xmlschema,
22 xmlsec,
23 zope-interface,
24}:
25
26buildPythonPackage rec {
27 pname = "pysaml2";
28 version = "7.5.0";
29 format = "pyproject";
30
31 disabled = pythonOlder "3.9";
32
33 src = fetchFromGitHub {
34 owner = "IdentityPython";
35 repo = "pysaml2";
36 rev = "refs/tags/v${version}";
37 hash = "sha256-M/tdKGu6K38TeBZc8/dt376bHhPB0svHB3iis/se0DY=";
38 };
39
40 patches = [
41 (substituteAll {
42 src = ./hardcode-xmlsec1-path.patch;
43 inherit xmlsec;
44 })
45 ];
46
47 postPatch = ''
48 # Fix failing tests on systems with 32bit time_t
49 sed -i 's/2999\(-.*T\)/2029\1/g' tests/*.xml
50 '';
51
52 pythonRelaxDeps = [ "xmlschema" ];
53
54 nativeBuildInputs = [
55 poetry-core
56 ];
57
58 propagatedBuildInputs = [
59 cryptography
60 defusedxml
61 pyopenssl
62 python-dateutil
63 pytz
64 requests
65 setuptools
66 xmlschema
67 ];
68
69 passthru.optional-dependencies = {
70 s2repoze = [
71 paste
72 repoze-who
73 zope-interface
74 ];
75 };
76
77 nativeCheckInputs = [
78 pyasn1
79 pymongo
80 pytestCheckHook
81 responses
82 ];
83
84 disabledTests = [
85 # Disabled tests try to access the network
86 "test_load_extern_incommon"
87 "test_load_remote_encoding"
88 "test_load_external"
89 "test_conf_syslog"
90 ];
91
92 pythonImportsCheck = [ "saml2" ];
93
94 meta = with lib; {
95 description = "Python implementation of SAML Version 2 Standard";
96 homepage = "https://github.com/IdentityPython/pysaml2";
97 changelog = "https://github.com/IdentityPython/pysaml2/blob/v${version}/CHANGELOG.md";
98 license = licenses.asl20;
99 maintainers = [ ];
100 };
101}