Skip to content

Commit 648501b

Browse files
rubenfonsecahuonwmgochoa
authored
chore(deps): remove email-validator; use Str over EmailStr in SES model (#1608)
Co-authored-by: Huon Wilson <[email protected]> Co-authored-by: Manuel Ochoa <[email protected]>
1 parent 18bee37 commit 648501b

File tree

5 files changed

+25
-62
lines changed

5 files changed

+25
-62
lines changed

aws_lambda_powertools/utilities/parser/models/ses.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from typing import List, Optional
33

44
from pydantic import BaseModel, Field
5-
from pydantic.networks import EmailStr
65
from pydantic.types import PositiveInt
76

87
from ..types import Literal
@@ -21,7 +20,7 @@ class SesReceiptAction(BaseModel):
2120
class SesReceipt(BaseModel):
2221
timestamp: datetime
2322
processingTimeMillis: PositiveInt
24-
recipients: List[EmailStr]
23+
recipients: List[str]
2524
spamVerdict: SesReceiptVerdict
2625
virusVerdict: SesReceiptVerdict
2726
spfVerdict: SesReceiptVerdict
@@ -41,17 +40,17 @@ class SesMailCommonHeaders(BaseModel):
4140
bcc: Optional[List[str]]
4241
sender: Optional[List[str]]
4342
reply_to: Optional[List[str]] = Field(None, alias="reply-to")
44-
returnPath: EmailStr
43+
returnPath: str
4544
messageId: str
4645
date: str
4746
subject: str
4847

4948

5049
class SesMail(BaseModel):
5150
timestamp: datetime
52-
source: EmailStr
51+
source: str
5352
messageId: str
54-
destination: List[EmailStr]
53+
destination: List[str]
5554
headersTruncated: bool
5655
headers: List[SesMailHeaders]
5756
commonHeaders: SesMailCommonHeaders

layer/layer/canary/app.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from importlib.metadata import version
66

77
import boto3
8-
from pydantic import EmailStr
8+
from pydantic import HttpUrl
99

1010
from aws_lambda_powertools import Logger, Metrics, Tracer
1111
from aws_lambda_powertools.utilities.parser import BaseModel, envelopes, event_parser
@@ -22,12 +22,12 @@
2222
event_bus_arn = os.getenv("VERSION_TRACKING_EVENT_BUS_ARN")
2323

2424

25-
# Model to check parser imports correctly, tests for pydantic and email-validator
25+
# Model to check parser imports correctly, tests for pydantic
2626
class OrderItem(BaseModel):
2727
order_id: int
2828
quantity: int
2929
description: str
30-
email: EmailStr
30+
url: HttpUrl
3131

3232

3333
# Tests for jmespath presence

poetry.lock

+15-49
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ python = "^3.7.4"
2323
aws-xray-sdk = { version = "^2.8.0", optional = true }
2424
fastjsonschema = { version = "^2.14.5", optional = true }
2525
pydantic = { version = "^1.8.2", optional = true }
26-
email-validator = { version = "^1.3.0", optional = true }
2726
boto3 = { version = "^1.20.32", optional = true }
2827

2928
[tool.poetry.dev-dependencies]
@@ -77,10 +76,10 @@ mypy-boto3-appconfigdata = "^1.24.36"
7776
importlib-metadata = "^4.13"
7877

7978
[tool.poetry.extras]
80-
parser = ["pydantic", "email-validator"]
79+
parser = ["pydantic"]
8180
validation = ["fastjsonschema"]
8281
tracer = ["aws-xray-sdk"]
83-
all = ["pydantic", "email-validator", "aws-xray-sdk", "fastjsonschema"]
82+
all = ["pydantic", "aws-xray-sdk", "fastjsonschema"]
8483
# allow customers to run code locally without emulators (SAM CLI, etc.)
8584
aws-sdk = ["boto3"]
8685
[tool.coverage.run]

tox.ini

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ deps =
66
filelock
77
pytest-xdist
88
pydantic
9-
email-validator
109

1110
commands = python parallel_run_e2e.py
1211

1312
; If you ever encounter another parallel lock across interpreters
1413
; pip install tox tox-poetry
15-
; tox -p --parallel-live
14+
; tox -p --parallel-live

0 commit comments

Comments
 (0)