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 asgiref, 16 django, 17 18 # optional-dependencies 19 fido2, 20 python3-openid, 21 python3-saml, 22 requests, 23 requests-oauthlib, 24 pyjwt, 25 qrcode, 26 27 # tests 28 django-ninja, 29 djangorestframework, 30 pillow, 31 psycopg2, 32 pytest-asyncio, 33 pytest-django, 34 pytestCheckHook, 35 pyyaml, 36 37 # passthru tests 38 dj-rest-auth, 39}: 40 41buildPythonPackage rec { 42 pname = "django-allauth"; 43 version = "65.7.0"; 44 pyproject = true; 45 46 disabled = pythonOlder "3.8"; 47 48 src = fetchFromGitHub { 49 owner = "pennersr"; 50 repo = "django-allauth"; 51 tag = version; 52 hash = "sha256-1HmEJ5E4Vp/CoyzUegqQXpzKUuz3dLx2EEv7dk8fq8w="; 53 }; 54 55 nativeBuildInputs = [ gettext ]; 56 57 build-system = [ setuptools ]; 58 59 dependencies = [ 60 asgiref 61 django 62 ]; 63 64 preBuild = '' 65 ${python.pythonOnBuildForHost.interpreter} -m django compilemessages 66 ''; 67 68 optional-dependencies = { 69 mfa = [ 70 fido2 71 qrcode 72 ]; 73 openid = [ python3-openid ]; 74 saml = [ python3-saml ]; 75 socialaccount = [ 76 requests 77 requests-oauthlib 78 pyjwt 79 ] ++ pyjwt.optional-dependencies.crypto; 80 steam = [ python3-openid ]; 81 }; 82 83 pythonImportsCheck = [ "allauth" ]; 84 85 nativeCheckInputs = [ 86 django-ninja 87 djangorestframework 88 pillow 89 psycopg2 90 pytest-asyncio 91 pytest-django 92 pytestCheckHook 93 pyyaml 94 ] ++ lib.flatten (builtins.attrValues optional-dependencies); 95 96 disabledTests = [ 97 # Tests require network access 98 "test_login" 99 ]; 100 101 passthru.tests = { inherit dj-rest-auth; }; 102 103 meta = { 104 changelog = "https://github.com/pennersr/django-allauth/blob/${version}/ChangeLog.rst"; 105 description = "Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication"; 106 downloadPage = "https://github.com/pennersr/django-allauth"; 107 homepage = "https://www.intenct.nl/projects/django-allauth"; 108 license = lib.licenses.mit; 109 maintainers = with lib.maintainers; [ derdennisop ]; 110 }; 111}