depot/third_party/nixpkgs/pkgs/development/python-modules/pysaml2/default.nix
Default email ce641f4048 Project import generated by Copybara.
GitOrigin-RevId: bc5d68306b40b8522ffb69ba6cff91898c2fbbff
2021-12-06 17:07:01 +01:00

88 lines
1.5 KiB
Nix

{ lib
, buildPythonPackage
, cryptography
, defusedxml
, fetchFromGitHub
, importlib-resources
, mock
, pyasn1
, pymongo
, pyopenssl
, pytestCheckHook
, python-dateutil
, pythonOlder
, pytz
, requests
, responses
, six
, substituteAll
, xmlschema
, xmlsec
}:
buildPythonPackage rec {
pname = "pysaml2";
version = "7.1.0";
format = "setuptools";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "IdentityPython";
repo = pname;
rev = "v${version}";
sha256 = "sha256-3Yl6j6KAlw7QQYnwU7+naY6D97IqX766zguekKAuic8=";
};
propagatedBuildInputs = [
cryptography
python-dateutil
defusedxml
pyopenssl
pytz
requests
six
xmlschema
] ++ lib.optionals (pythonOlder "3.9") [
importlib-resources
];
checkInputs = [
mock
pyasn1
pymongo
pytestCheckHook
responses
];
patches = [
(substituteAll {
src = ./hardcode-xmlsec1-path.patch;
inherit xmlsec;
})
];
postPatch = ''
# fix failing tests on systems with 32bit time_t
sed -i 's/2999\(-.*T\)/2029\1/g' tests/*.xml
'';
disabledTests = [
# Disabled tests try to access the network
"test_load_extern_incommon"
"test_load_remote_encoding"
"test_load_external"
"test_conf_syslog"
];
pythonImportsCheck = [
"saml2"
];
meta = with lib; {
description = "Python implementation of SAML Version 2 Standard";
homepage = "https://github.com/IdentityPython/pysaml2";
license = licenses.asl20;
maintainers = with maintainers; [ ];
};
}