From 43dc57e03e6c46465654832b5d70231946e5dae0 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 22 Nov 2021 17:10:35 +0100 Subject: [PATCH 1/2] python3Packages.pysaml2: 7.0.1 -> 7.1.0 --- .../python-modules/pysaml2/default.nix | 40 ++++++++++++++----- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/pysaml2/default.nix b/pkgs/development/python-modules/pysaml2/default.nix index 6eeb10b6dcd9..ce1fe4b936fc 100644 --- a/pkgs/development/python-modules/pysaml2/default.nix +++ b/pkgs/development/python-modules/pysaml2/default.nix @@ -1,25 +1,36 @@ { lib , buildPythonPackage -, isPy3k +, pythonOlder , fetchFromGitHub , substituteAll , xmlsec -, cryptography, defusedxml, pyopenssl, python-dateutil, pytz, requests, six -, mock, pyasn1, pymongo, pytest, responses, xmlschema, importlib-resources +, cryptography +, defusedxml +, pyopenssl +, python-dateutil +, pytz, requests +, six +, mock +, pyasn1 +, pymongo +, pytest +, responses +, xmlschema +, importlib-resources }: buildPythonPackage rec { pname = "pysaml2"; - version = "7.0.1"; + version = "7.1.0"; + format = "setuptools"; - disabled = !isPy3k; + disabled = pythonOlder "3.6"; - # No tests in PyPI tarball src = fetchFromGitHub { owner = "IdentityPython"; repo = pname; rev = "v${version}"; - sha256 = "0ickqask6bjipgi3pvxg92pjr6dk2rr3q9garap39mdrp2gsfhln"; + sha256 = "sha256-3Yl6j6KAlw7QQYnwU7+naY6D97IqX766zguekKAuic8="; }; patches = [ @@ -38,15 +49,22 @@ buildPythonPackage rec { cryptography python-dateutil defusedxml - importlib-resources pyopenssl pytz requests six xmlschema + ] ++ lib.optionals (pythonOlder "3.9") [ + importlib-resources ]; - checkInputs = [ mock pyasn1 pymongo pytest responses ]; + checkInputs = [ + mock + pyasn1 + pymongo + pytest + responses + ]; # Disabled tests try to access the network checkPhase = '' @@ -57,9 +75,9 @@ buildPythonPackage rec { ''; meta = with lib; { - homepage = "https://github.com/rohe/pysaml2"; description = "Python implementation of SAML Version 2 Standard"; + homepage = "https://github.com/IdentityPython/pysaml2"; license = licenses.asl20; + maintainers = with maintainers; [ ]; }; - } From 25bfb58ed0bda9c0532d3c9c6a3ffad99b717f43 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 22 Nov 2021 17:15:52 +0100 Subject: [PATCH 2/2] python3Packages.pysaml2: switch to pytestCheckHook --- .../python-modules/pysaml2/default.nix | 63 ++++++++++--------- 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/pkgs/development/python-modules/pysaml2/default.nix b/pkgs/development/python-modules/pysaml2/default.nix index ce1fe4b936fc..bc21b0a309d1 100644 --- a/pkgs/development/python-modules/pysaml2/default.nix +++ b/pkgs/development/python-modules/pysaml2/default.nix @@ -1,22 +1,23 @@ { lib , buildPythonPackage -, pythonOlder -, fetchFromGitHub -, substituteAll -, xmlsec , cryptography , defusedxml -, pyopenssl -, python-dateutil -, pytz, requests -, six +, fetchFromGitHub +, importlib-resources , mock , pyasn1 , pymongo -, pytest +, pyopenssl +, pytestCheckHook +, python-dateutil +, pythonOlder +, pytz +, requests , responses +, six +, substituteAll , xmlschema -, importlib-resources +, xmlsec }: buildPythonPackage rec { @@ -33,18 +34,6 @@ buildPythonPackage rec { sha256 = "sha256-3Yl6j6KAlw7QQYnwU7+naY6D97IqX766zguekKAuic8="; }; - 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 - ''; - propagatedBuildInputs = [ cryptography python-dateutil @@ -62,18 +51,34 @@ buildPythonPackage rec { mock pyasn1 pymongo - pytest + pytestCheckHook responses ]; - # Disabled tests try to access the network - checkPhase = '' - py.test -k "not test_load_extern_incommon \ - and not test_load_remote_encoding \ - and not test_load_external \ - and not test_conf_syslog" + 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";