Skip to content

Commit

Permalink
replace validate-email with pyIsEmail
Browse files Browse the repository at this point in the history
  • Loading branch information
bmos committed Sep 19, 2024
1 parent 705a825 commit 0d3940b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions parsons/notifications/sendmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from email.mime.text import MIMEText
from email.utils import parseaddr

from validate_email import validate_email
from pyisemail import is_email

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

if not validate_email(email_addr):
if not is_email(email_addr):
raise ValueError("Invalid email address.")

return True
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ oauth2client==4.1.3
paramiko==3.4.0
petl==1.7.15
psycopg2-binary==2.9.9
pyIsEmail==2.0.1
PyGitHub==1.51
python-dateutil==2.8.2
requests==2.32.3
Expand All @@ -41,7 +42,6 @@ suds-py3==1.4.4.1
surveygizmo==1.2.3
twilio==8.2.1
urllib3==1.26.19
validate-email==1.3
xmltodict==0.11.0

# Stuff for TMC scripts
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def main():
"gspread",
"httplib2",
"oauth2client",
"validate-email",
"pyIsEmail",
],
"mysql": [
"mysql-connector-python",
Expand All @@ -62,7 +62,7 @@ def main():
"scytl": ["defusedxml", "pytz"],
"sftp": ["paramiko"],
"slack": ["slackclient<2"],
"smtp": ["validate-email"],
"smtp": ["pyIsEmail"],
"targetsmart": ["xmltodict", "defusedxml"],
"twilio": ["twilio"],
"ssh": [
Expand Down
4 changes: 2 additions & 2 deletions test/test_gmail/test_gmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,8 @@ def test__validate_email_string(self):
{"email": "<[email protected]>", "expected": True},
{"email": "Sender [email protected]", "expected": False},
{"email": "Sender <sender2email.com>", "expected": False},
{"email": "Sender <sender@email,com>", "expected": True},
{"email": "Sender <sender+alias@email,com>", "expected": True},
{"email": "Sender <sender@email,com>", "expected": False},
{"email": "Sender <sender+alias@email,com>", "expected": False},
]

for e in emails:
Expand Down

0 comments on commit 0d3940b

Please sign in to comment.