Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / social-auth-core / default.nix
blob5506f417be04c521a76908c832c9cac3c215aa37
1 { lib
2 , buildPythonPackage
3 , cryptography
4 , defusedxml
5 , fetchFromGitHub
6 , httpretty
7 , lxml
8 , oauthlib
9 , pyjwt
10 , pytestCheckHook
11 , python-jose
12 , python3-openid
13 , python3-saml
14 , pythonOlder
15 , requests
16 , requests-oauthlib
19 buildPythonPackage rec {
20   pname = "social-auth-core";
21   version = "4.4.2";
22   format = "setuptools";
24   disabled = pythonOlder "3.7";
26   src = fetchFromGitHub {
27     owner = "python-social-auth";
28     repo = "social-core";
29     rev = "refs/tags/${version}";
30     hash = "sha256-o/qx3bwaj2fiNKM3fafFxOW27JrJ9jG4M4uSnnJDpes=";
31   };
33   propagatedBuildInputs = [
34     cryptography
35     defusedxml
36     oauthlib
37     pyjwt
38     python3-openid
39     requests
40     requests-oauthlib
41   ];
43   passthru.optional-dependencies = {
44     openidconnect = [
45       python-jose
46     ];
47     saml = [
48       lxml
49       python3-saml
50     ];
51     azuread = [
52       cryptography
53     ];
54   };
56   nativeCheckInputs = [
57     pytestCheckHook
58     httpretty
59   ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
61   # Disable checking the code coverage
62   prePatch = ''
63     substituteInPlace social_core/tests/requirements.txt \
64       --replace "coverage>=3.6" "" \
65       --replace "pytest-cov>=2.7.1" ""
67     substituteInPlace tox.ini \
68       --replace "{posargs:-v --cov=social_core}" "{posargs:-v}"
69   '';
71   pythonImportsCheck = [
72     "social_core"
73   ];
75   meta = with lib; {
76     description = "Module for social authentication/registration mechanisms";
77     homepage = "https://github.com/python-social-auth/social-core";
78     license = licenses.bsd3;
79     maintainers = with maintainers; [ n0emis ];
80   };