1{ lib
2, buildPythonPackage
3, cryptography
4, defusedxml
5, fetchFromGitHub
6, fetchPypi
7, importlib-resources
8, mock
9, pyasn1
10, pymongo
11, pyopenssl
12, pytestCheckHook
13, python-dateutil
14, pythonOlder
15, pytz
16, requests
17, responses
18, setuptools
19, six
20, substituteAll
21, xmlschema
22, xmlsec
23}:
24
25let
26 pymongo3 = pymongo.overridePythonAttrs(old: rec {
27 version = "3.12.3";
28 src = fetchPypi {
29 pname = "pymongo";
30 inherit version;
31 sha256 = "sha256-ConK3ABipeU2ZN3gQ/bAlxcrjBxfAJRJAJUoL/mZWl8=";
32 };
33 });
34in buildPythonPackage rec {
35 pname = "pysaml2";
36 version = "7.2.1";
37 format = "setuptools";
38
39 disabled = pythonOlder "3.6";
40
41 src = fetchFromGitHub {
42 owner = "IdentityPython";
43 repo = pname;
44 rev = "v${version}";
45 sha256 = "sha256-lnaizwbtBYdKx1puizah+UWsw54NVW6UhEw/eStl1WI=";
46 };
47
48 propagatedBuildInputs = [
49 cryptography
50 defusedxml
51 pyopenssl
52 python-dateutil
53 pytz
54 requests
55 setuptools
56 six
57 xmlschema
58 ] ++ lib.optionals (pythonOlder "3.9") [
59 importlib-resources
60 ];
61
62 checkInputs = [
63 mock
64 pyasn1
65 pymongo3
66 pytestCheckHook
67 responses
68 ];
69
70 patches = [
71 (substituteAll {
72 src = ./hardcode-xmlsec1-path.patch;
73 inherit xmlsec;
74 })
75 ];
76
77 postPatch = ''
78 # fix failing tests on systems with 32bit time_t
79 sed -i 's/2999\(-.*T\)/2029\1/g' tests/*.xml
80 '';
81
82 disabledTests = [
83 # Disabled tests try to access the network
84 "test_load_extern_incommon"
85 "test_load_remote_encoding"
86 "test_load_external"
87 "test_conf_syslog"
88 ];
89
90 pythonImportsCheck = [
91 "saml2"
92 ];
93
94 meta = with lib; {
95 description = "Python implementation of SAML Version 2 Standard";
96 homepage = "https://github.com/IdentityPython/pysaml2";
97 license = licenses.asl20;
98 maintainers = with maintainers; [ ];
99 };
100}