Skip to content

Commit 792b4a6

Browse files
fix(models): replace EmailStr with str, drop email-validator dependency
EmailStr pulled in email-validator + dnspython as transitive deps — a third-party email validator inside an email validation SDK. The API already validates the email; re-validating it client-side in the response model is redundant and adds 2 unnecessary dependencies. Using plain `str` for the email field in response models eliminates the dependency that caused the original ImportError crash while also producing a lighter, more correct SDK.
1 parent 7fd5c35 commit 792b4a6

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
aiohttp>=3.9.0
2-
pydantic[email]>=2.0.0
2+
pydantic>=2.0.0
33
python-dotenv>=1.0.0
44
typing-extensions>=4.8.0

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ packages = find:
3131
python_requires = >=3.8
3232
install_requires =
3333
aiohttp>=3.9.0
34-
pydantic[email]>=2.0.0
34+
pydantic>=2.0.0
3535
python-dotenv>=1.0.0
3636
typing-extensions>=4.8.0
3737

setup_minimal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
python_requires=">=3.8",
1717
install_requires=[
1818
"aiohttp>=3.9.0",
19-
"pydantic[email]>=2.0.0",
19+
"pydantic>=2.0.0",
2020
"python-dotenv>=1.0.0",
2121
"typing-extensions>=4.8.0",
2222
],

validkit/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import Optional, List, Dict, Any, Union
44
from datetime import datetime
55
from enum import Enum
6-
from pydantic import BaseModel, Field, EmailStr, validator
6+
from pydantic import BaseModel, Field, validator
77

88

99
class ResponseFormat(str, Enum):
@@ -58,7 +58,7 @@ class SMTPCheck(BaseModel):
5858
class EmailVerificationResult(BaseModel):
5959
"""Full email verification result"""
6060
success: bool
61-
email: EmailStr
61+
email: str
6262
valid: bool
6363

6464
# Detailed checks

0 commit comments

Comments
 (0)