depot/third_party/nixpkgs/pkgs/development/python-modules/pysaml2/default.nix
Default email 7bc014aa9c Project import generated by Copybara.
GitOrigin-RevId: c97e777ff06fcb8d37dcdf5e21e9eff1f34f0e90
2022-09-11 12:47:08 -03:00

100 lines
1.8 KiB
Nix

{ lib
, buildPythonPackage
, cryptography
, defusedxml
, fetchFromGitHub
, fetchPypi
, importlib-resources
, mock
, pyasn1
, pymongo
, pyopenssl
, pytestCheckHook
, python-dateutil
, pythonOlder
, pytz
, requests
, responses
, setuptools
, six
, substituteAll
, xmlschema
, xmlsec
}:
let
pymongo3 = pymongo.overridePythonAttrs(old: rec {
version = "3.12.3";
src = fetchPypi {
pname = "pymongo";
inherit version;
sha256 = "sha256-ConK3ABipeU2ZN3gQ/bAlxcrjBxfAJRJAJUoL/mZWl8=";
};
});
in buildPythonPackage rec {
pname = "pysaml2";
version = "7.2.1";
format = "setuptools";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "IdentityPython";
repo = pname;
rev = "v${version}";
sha256 = "sha256-lnaizwbtBYdKx1puizah+UWsw54NVW6UhEw/eStl1WI=";
};
propagatedBuildInputs = [
cryptography
defusedxml
pyopenssl
python-dateutil
pytz
requests
setuptools
six
xmlschema
] ++ lib.optionals (pythonOlder "3.9") [
importlib-resources
];
checkInputs = [
mock
pyasn1
pymongo3
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; [ ];
};
}