1{ stdenv
2, buildPythonPackage
3, fetchFromGitHub
4, substituteAll
5, xmlsec
6, cryptography, defusedxml, future, pyopenssl, dateutil, pytz, requests, six
7, mock, pyasn1, pymongo, pytest, responses
8}:
9
10buildPythonPackage rec {
11 pname = "pysaml2";
12 version = "4.6.5";
13
14 # No tests in PyPI tarball
15 src = fetchFromGitHub {
16 owner = "IdentityPython";
17 repo = pname;
18 rev = "v${version}";
19 sha256 = "0xlbr52vzx1j9sg65jhqv01vp4a49afjy03lc2zb0ggx0xxzngvb";
20 };
21
22 patches = [
23 (substituteAll {
24 src = ./hardcode-xmlsec1-path.patch;
25 inherit xmlsec;
26 })
27 ];
28
29 propagatedBuildInputs = [ cryptography defusedxml future pyopenssl dateutil pytz requests six ];
30
31 checkInputs = [ mock pyasn1 pymongo pytest responses ];
32
33 # Disabled tests try to access the network
34 checkPhase = ''
35 py.test -k "not test_load_extern_incommon \
36 and not test_load_remote_encoding \
37 and not test_load_external"
38 '';
39
40 meta = with stdenv.lib; {
41 homepage = "https://github.com/rohe/pysaml2";
42 description = "Python implementation of SAML Version 2 Standard";
43 license = licenses.asl20;
44 };
45
46}