1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 pythonOlder, 6 python, 7 8 # build-system 9 setuptools, 10 11 # build-time dependencies 12 gettext, 13 14 # dependencies 15 django, 16 python3-openid, 17 requests, 18 requests-oauthlib, 19 pyjwt, 20 21 # optional-dependencies 22 python3-saml, 23 qrcode, 24 25 # tests 26 pillow, 27 pytestCheckHook, 28 pytest-django, 29 30 # passthru tests 31 dj-rest-auth, 32}: 33 34buildPythonPackage rec { 35 pname = "django-allauth"; 36 version = "0.61.1"; 37 pyproject = true; 38 39 disabled = pythonOlder "3.7"; 40 41 src = fetchFromGitHub { 42 owner = "pennersr"; 43 repo = "django-allauth"; 44 rev = "refs/tags/${version}"; 45 hash = "sha256-C9SYlL1yMnSb+Zpi2opvDw1stxAHuI9/XKHyvkM36Cg="; 46 }; 47 48 nativeBuildInputs = [ 49 gettext 50 setuptools 51 ]; 52 53 propagatedBuildInputs = [ 54 django 55 pyjwt 56 python3-openid 57 requests 58 requests-oauthlib 59 ] ++ pyjwt.optional-dependencies.crypto; 60 61 preBuild = "${python.interpreter} -m django compilemessages"; 62 63 passthru.optional-dependencies = { 64 saml = [ python3-saml ]; 65 mfa = [ qrcode ]; 66 }; 67 68 pythonImportsCheck = [ "allauth" ]; 69 70 nativeCheckInputs = [ 71 pillow 72 pytestCheckHook 73 pytest-django 74 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies); 75 76 disabledTests = [ 77 # Tests require network access 78 "test_login" 79 ]; 80 81 passthru.tests = { 82 inherit dj-rest-auth; 83 }; 84 85 meta = with lib; { 86 changelog = "https://github.com/pennersr/django-allauth/blob/${version}/ChangeLog.rst"; 87 description = "Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication"; 88 downloadPage = "https://github.com/pennersr/django-allauth"; 89 homepage = "https://www.intenct.nl/projects/django-allauth"; 90 license = licenses.mit; 91 maintainers = with maintainers; [ derdennisop ]; 92 }; 93}