nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromCodeberg,
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.14.0";
45 pyproject = true;
46
47 src = fetchFromCodeberg {
48 owner = "allauth";
49 repo = "django-allauth";
50 tag = version;
51 hash = "sha256-hoPNSMzn/bX98Qe+7guaLK8UhA5FfHpUCjzN6hCXVgs=";
52 };
53
54 nativeBuildInputs = [ gettext ];
55
56 build-system = [
57 setuptools
58 setuptools-scm
59 ];
60
61 dependencies = [
62 asgiref
63 django
64 ];
65
66 preBuild = ''
67 ${python.pythonOnBuildForHost.interpreter} -m django compilemessages
68 '';
69
70 optional-dependencies = {
71 headless = [
72 pyjwt
73 ]
74 ++ pyjwt.optional-dependencies.crypto;
75 headless-spec = [ pyyaml ];
76 idp-oidc = [
77 oauthlib
78 pyjwt
79 ]
80 ++ pyjwt.optional-dependencies.crypto;
81 mfa = [
82 fido2
83 qrcode
84 ];
85 openid = [ python3-openid ];
86 saml = [ python3-saml ];
87 socialaccount = [
88 requests
89 requests-oauthlib
90 pyjwt
91 ]
92 ++ pyjwt.optional-dependencies.crypto;
93 steam = [ python3-openid ];
94 };
95
96 pythonImportsCheck = [ "allauth" ];
97
98 nativeCheckInputs = [
99 django-ninja
100 djangorestframework
101 pillow
102 psycopg2
103 pytest-asyncio
104 pytest-django
105 pytestCheckHook
106 pyyaml
107 ]
108 ++ lib.concatAttrValues optional-dependencies;
109
110 disabledTests = [
111 # Tests require network access
112 "test_login"
113 ];
114
115 passthru.tests = { inherit dj-rest-auth; };
116
117 meta = {
118 description = "Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication";
119 changelog = "https://codeberg.org/allauth/django-allauth/src/tag/${src.tag}/ChangeLog.rst";
120 downloadPage = "https://codeberg.org/allauth/django-allauth";
121 homepage = "https://allauth.org";
122 license = lib.licenses.mit;
123 maintainers = with lib.maintainers; [ derdennisop ];
124 };
125}