Skip to content

Commit 49c23ca

Browse files
author
Wil Thieme
committed
replace validate-email with pyIsEmail
1 parent 244ca49 commit 49c23ca

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

parsons/notifications/sendmail.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from email.mime.text import MIMEText
1414
from email.utils import parseaddr
1515

16-
from validate_email import validate_email
16+
from pyisemail import is_email
1717

1818
# BUG: can't send files equal to or larger than 6MB
1919
# There is a possible fix
@@ -196,7 +196,7 @@ def _validate_email_string(self, str):
196196
if not email_addr:
197197
raise ValueError("Invalid email address.")
198198

199-
if not validate_email(email_addr):
199+
if not is_email(email_addr):
200200
raise ValueError("Invalid email address.")
201201

202202
return True

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ oauth2client==4.1.3
2828
paramiko==3.4.0
2929
petl==1.7.15
3030
psycopg2-binary==2.9.9
31+
pyIsEmail==2.0.1
3132
PyGitHub==1.51
3233
python-dateutil==2.8.2
3334
requests==2.32.3
@@ -41,7 +42,6 @@ suds-py3==1.4.4.1
4142
surveygizmo==1.2.3
4243
twilio==8.2.1
4344
urllib3==1.26.19
44-
validate-email==1.3
4545
xmltodict==0.11.0
4646

4747
# Stuff for TMC scripts

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def main():
3939
"gspread",
4040
"httplib2",
4141
"oauth2client",
42-
"validate-email",
42+
"pyIsEmail",
4343
],
4444
"mysql": [
4545
"mysql-connector-python",
@@ -62,7 +62,7 @@ def main():
6262
"scytl": ["defusedxml", "pytz"],
6363
"sftp": ["paramiko"],
6464
"slack": ["slackclient<2"],
65-
"smtp": ["validate-email"],
65+
"smtp": ["pyIsEmail"],
6666
"targetsmart": ["xmltodict", "defusedxml"],
6767
"twilio": ["twilio"],
6868
"ssh": [

test/test_gmail/test_gmail.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,8 @@ def test__validate_email_string(self):
517517
{"email": "<[email protected]>", "expected": True},
518518
{"email": "Sender [email protected]", "expected": False},
519519
{"email": "Sender <sender2email.com>", "expected": False},
520-
{"email": "Sender <sender@email,com>", "expected": True},
521-
{"email": "Sender <sender+alias@email,com>", "expected": True},
520+
{"email": "Sender <sender@email,com>", "expected": False},
521+
{"email": "Sender <sender+alias@email,com>", "expected": False},
522522
]
523523

524524
for e in emails:

0 commit comments

Comments
 (0)