1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitea, 5 python, 6 7 # build-system 8 setuptools, 9 setuptools-scm, 10 11 # build-time dependencies 12 gettext, 13 14 # dependencies 15 asgiref, 16 django, 17 18 # optional-dependencies 19 fido2, 20 oauthlib, 21 python3-openid, 22 python3-saml, 23 requests, 24 requests-oauthlib, 25 pyjwt, 26 qrcode, 27 28 # tests 29 django-ninja, 30 djangorestframework, 31 pillow, 32 psycopg2, 33 pytest-asyncio, 34 pytest-django, 35 pytestCheckHook, 36 pyyaml, 37 38 # passthru tests 39 dj-rest-auth, 40}: 41 42buildPythonPackage rec { 43 pname = "django-allauth"; 44 version = "65.11.2"; 45 pyproject = true; 46 47 src = fetchFromGitea { 48 domain = "codeberg.org"; 49 owner = "allauth"; 50 repo = "django-allauth"; 51 tag = version; 52 hash = "sha256-JqG4fAm5aOUbySQpgLi1NiSvip1/ndVGP6JCe8QmsRs="; 53 }; 54 55 nativeBuildInputs = [ gettext ]; 56 57 build-system = [ 58 setuptools 59 setuptools-scm 60 ]; 61 62 dependencies = [ 63 asgiref 64 django 65 ]; 66 67 preBuild = '' 68 ${python.pythonOnBuildForHost.interpreter} -m django compilemessages 69 ''; 70 71 optional-dependencies = { 72 headless-spec = [ pyyaml ]; 73 idp-oidc = [ 74 oauthlib 75 pyjwt 76 ] 77 ++ pyjwt.optional-dependencies.crypto; 78 mfa = [ 79 fido2 80 qrcode 81 ]; 82 openid = [ python3-openid ]; 83 saml = [ python3-saml ]; 84 socialaccount = [ 85 requests 86 requests-oauthlib 87 pyjwt 88 ] 89 ++ pyjwt.optional-dependencies.crypto; 90 steam = [ python3-openid ]; 91 }; 92 93 pythonImportsCheck = [ "allauth" ]; 94 95 nativeCheckInputs = [ 96 django-ninja 97 djangorestframework 98 pillow 99 psycopg2 100 pytest-asyncio 101 pytest-django 102 pytestCheckHook 103 pyyaml 104 ] 105 ++ lib.flatten (builtins.attrValues optional-dependencies); 106 107 disabledTests = [ 108 # Tests require network access 109 "test_login" 110 ]; 111 112 passthru.tests = { inherit dj-rest-auth; }; 113 114 meta = { 115 description = "Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication"; 116 changelog = "https://codeberg.org/allauth/django-allauth/src/tag/${src.tag}/ChangeLog.rst"; 117 downloadPage = "https://codeberg.org/allauth/django-allauth"; 118 homepage = "https://allauth.org"; 119 license = lib.licenses.mit; 120 maintainers = with lib.maintainers; [ derdennisop ]; 121 }; 122}