File tree Expand file tree Collapse file tree 7 files changed +22
-30
lines changed Expand file tree Collapse file tree 7 files changed +22
-30
lines changed Original file line number Diff line number Diff line change 6565 - " 3.9"
6666 - " 3.10"
6767 - " 3.11"
68+ django-version :
69+ - " 4.0"
70+ - " 4.1"
71+ - " 4.2"
6872 steps :
6973 - uses : actions/checkout@v4
7074 - uses : actions/setup-python@v4
@@ -102,12 +106,7 @@ jobs:
102106 runs-on : ubuntu-latest
103107 strategy :
104108 matrix :
105- python-version : [ "3.10" ]
106- django-version :
107- - " 4.0"
108- - " 4.1"
109- extras :
110- - postgres
109+ python-version : [ "3.x" ]
111110 services :
112111 postgres :
113112 image : postgres
@@ -123,7 +122,7 @@ jobs:
123122 with :
124123 python-version : ${{ matrix.python-version }}
125124 - uses : actions/checkout@v4
126- - run : python -m pip install Django~=${{ matrix.django-version }}.0 - e ".[test,${{ matrix.extras }} ]"
125+ - run : python -m pip install - e ".[test,postgres ]"
127126 - run : python -m pytest
128127 env :
129128 DB_PORT : ${{ job.services.postgres.ports[5432] }}
Original file line number Diff line number Diff line change 11from django .db import migrations
22
33try :
4- from django . contrib . postgres . fields import CIEmailField
4+ from citext import CIEmailField , CITextExtension
55except ImportError :
6+ CITextExtension = None
67 CIEmailField = None
7- else :
8- from django .contrib .postgres .operations import CITextExtension
98
109
1110def _operations ():
12- if CIEmailField :
11+ if CITextExtension :
1312 yield CITextExtension ()
1413 yield migrations .AlterField (
1514 model_name = "emailuser" ,
Original file line number Diff line number Diff line change 11from django .db import migrations , models
22
33try :
4- from django . contrib . postgres . fields import CIEmailField
4+ from citext import CIEmailField
55except ImportError :
66 CIEmailField = models .EmailField
77
Original file line number Diff line number Diff line change 77from . import signals
88
99try :
10- from django . contrib . postgres . fields import CIEmailField
10+ from citext import CIEmailField
1111except ImportError :
1212 from django .db .models import EmailField as CIEmailField
1313
Original file line number Diff line number Diff line change @@ -14,10 +14,7 @@ keywords = [
1414 " otp" ,
1515 " email" ,
1616 " authentication" ,
17- " login" ,
18- " 2fa" ,
1917 " passwordless" ,
20- " password" ,
2118]
2219dynamic = [" version" , " description" ]
2320classifiers = [
@@ -34,13 +31,20 @@ classifiers = [
3431 " Framework :: Django" ,
3532 " Framework :: Django :: 4.0" ,
3633 " Framework :: Django :: 4.1" ,
34+ " Framework :: Django :: 4.2" ,
35+ " Framework :: Wagtail" ,
36+ " Framework :: Wagtail :: 2" ,
37+ " Framework :: Wagtail :: 3" ,
38+ " Framework :: Wagtail :: 4" ,
3739 " Topic :: Internet" ,
3840 " Topic :: Internet :: WWW/HTTP" ,
3941 " Topic :: Software Development :: Quality Assurance" ,
4042 " Topic :: Software Development :: Testing" ,
4143]
4244requires-python = " >=3.9"
43- dependencies = [" django>=4.0" ]
45+ dependencies = [
46+ " django>=4.0"
47+ ]
4448
4549[project .optional-dependencies ]
4650test = [
@@ -55,7 +59,7 @@ wagtail = [
5559 " wagtail>=2.8" ,
5660]
5761postgres = [
58- " psycopg2-binary " ,
62+ " django-citext " ,
5963]
6064
6165[project .urls ]
Original file line number Diff line number Diff line change 33
44from mailauth .contrib .user import models
55
6- try :
7- import psycopg2
8- except ImportError :
9- psycopg2 = None
10-
11-
12- postgres_only = pytest .mark .skipif (
13- psycopg2 is None , reason = "at least mymodule-1.1 required"
14- )
15-
166
177class TestEmailUser :
18- @postgres_only
198 def test_email__ci_unique (self , db ):
9+ pytest .importorskip ("psycopg" )
2010 models .EmailUser .objects .create_user ("IronMan@avengers.com" )
2111 with pytest .raises (IntegrityError ):
2212 models .EmailUser .objects .create_user ("ironman@avengers.com" )
Original file line number Diff line number Diff line change 5252 "mailauth.contrib.wagtail" ,
5353 "wagtail.admin" ,
5454 "wagtail.users" ,
55- "wagtail.core " ,
55+ "wagtail" ,
5656 ]
5757
5858AUTHENTICATION_BACKENDS = ("mailauth.backends.MailAuthBackend" ,)
You can’t perform that action at this time.
0 commit comments