From bb77639d025689f4dcab1b09dd54cc8c3f0aa71a Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 14 Jun 2022 05:38:58 +0000 Subject: [PATCH 1/2] python310Packages.social-auth-core: 4.2.0 -> 4.3.0 --- .../development/python-modules/social-auth-core/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/social-auth-core/default.nix b/pkgs/development/python-modules/social-auth-core/default.nix index 667c4ec4245..664878411b0 100644 --- a/pkgs/development/python-modules/social-auth-core/default.nix +++ b/pkgs/development/python-modules/social-auth-core/default.nix @@ -16,13 +16,13 @@ buildPythonPackage rec { pname = "social-auth-core"; - version = "4.2.0"; + version = "4.3.0"; src = fetchFromGitHub { owner = "python-social-auth"; repo = "social-core"; - rev = version; - sha256 = "sha256-kaL6sfAyQlzxszCEbhW7sns/mcOv0U+QgplmUd6oegQ="; + rev = "refs/tags/${version}"; + sha256 = "sha256-P9IWnu1/PWVNl/tZZ4bqz0WnruKu/jXASZBoaWXWeYI="; }; # Disable checking the code coverage From 76d82cd78a9ac5a766ec74ff3a0c589692242848 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 14 Jun 2022 08:51:45 +0200 Subject: [PATCH 2/2] python310Packages.social-auth-core: handle optional dependencies --- .../social-auth-core/default.nix | 72 ++++++++++++------- 1 file changed, 46 insertions(+), 26 deletions(-) diff --git a/pkgs/development/python-modules/social-auth-core/default.nix b/pkgs/development/python-modules/social-auth-core/default.nix index 664878411b0..b00e5044c64 100644 --- a/pkgs/development/python-modules/social-auth-core/default.nix +++ b/pkgs/development/python-modules/social-auth-core/default.nix @@ -1,30 +1,65 @@ { lib , buildPythonPackage +, cryptography +, defusedxml , fetchFromGitHub -, requests +, httpretty +, lxml , oauthlib -, requests-oauthlib , pyjwt -, cryptography -, defusedxml -, python3-openid +, pytestCheckHook , python-jose +, python3-openid , python3-saml -, pytestCheckHook -, httpretty +, pythonOlder +, requests +, requests-oauthlib }: buildPythonPackage rec { pname = "social-auth-core"; version = "4.3.0"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "python-social-auth"; repo = "social-core"; rev = "refs/tags/${version}"; - sha256 = "sha256-P9IWnu1/PWVNl/tZZ4bqz0WnruKu/jXASZBoaWXWeYI="; + hash = "sha256-P9IWnu1/PWVNl/tZZ4bqz0WnruKu/jXASZBoaWXWeYI="; }; + propagatedBuildInputs = [ + cryptography + defusedxml + oauthlib + pyjwt + python3-openid + requests + requests-oauthlib + ]; + + passthru.optional-dependencies = { + openidconnect = [ + python-jose + ]; + saml = [ + lxml + python3-saml + ]; + azuread = [ + cryptography + ]; + }; + + checkInputs = [ + pytestCheckHook + httpretty + ] ++ passthru.optional-dependencies.openidconnect + ++ passthru.optional-dependencies.saml + ++ passthru.optional-dependencies.azuread; + # Disable checking the code coverage prePatch = '' substituteInPlace social_core/tests/requirements.txt \ @@ -35,28 +70,13 @@ buildPythonPackage rec { --replace "{posargs:-v --cov=social_core}" "{posargs:-v}" ''; - propagatedBuildInputs = [ - requests - oauthlib - requests-oauthlib - pyjwt - cryptography - defusedxml - python3-openid - python-jose - python3-saml - ]; - - checkInputs = [ - pytestCheckHook - httpretty + pythonImportsCheck = [ + "social_core" ]; - pythonImportsCheck = [ "social_core" ]; - meta = with lib; { + description = "Module for social authentication/registration mechanisms"; homepage = "https://github.com/python-social-auth/social-core"; - description = "Python Social Auth - Core"; license = licenses.bsd3; maintainers = with maintainers; [ n0emis ]; };