1{
2 lib,
3 buildPythonPackage,
4 cryptography,
5 defusedxml,
6 fetchFromGitHub,
7 httpretty,
8 lxml,
9 oauthlib,
10 pyjwt,
11 pytestCheckHook,
12 python-jose,
13 python3-openid,
14 python3-saml,
15 pythonOlder,
16 requests,
17 requests-oauthlib,
18 setuptools,
19}:
20
21buildPythonPackage rec {
22 pname = "social-auth-core";
23 version = "4.5.4";
24 pyproject = true;
25
26 disabled = pythonOlder "3.7";
27
28 src = fetchFromGitHub {
29 owner = "python-social-auth";
30 repo = "social-core";
31 rev = "refs/tags/${version}";
32 hash = "sha256-tFaRvNoO5K7ytqMhL//Ntasc7jb4PYXB1yyjFvFqQH8=";
33 };
34
35 nativeBuildInputs = [ setuptools ];
36
37 propagatedBuildInputs = [
38 cryptography
39 defusedxml
40 oauthlib
41 pyjwt
42 python3-openid
43 requests
44 requests-oauthlib
45 ];
46
47 passthru.optional-dependencies = {
48 openidconnect = [ python-jose ];
49 saml = [
50 lxml
51 python3-saml
52 ];
53 azuread = [ cryptography ];
54 };
55
56 nativeCheckInputs = [
57 pytestCheckHook
58 httpretty
59 ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
60
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" ""
66
67 substituteInPlace tox.ini \
68 --replace "{posargs:-v --cov=social_core}" "{posargs:-v}"
69 '';
70
71 pythonImportsCheck = [ "social_core" ];
72
73 meta = with lib; {
74 description = "Module for social authentication/registration mechanisms";
75 homepage = "https://github.com/python-social-auth/social-core";
76 changelog = "https://github.com/python-social-auth/social-core/blob/${version}/CHANGELOG.md";
77 license = licenses.bsd3;
78 maintainers = with maintainers; [ n0emis ];
79 };
80}