Skip to content

Commit

Permalink
chore(deps): remove email-validator; use Str over EmailStr in SES mod…
Browse files Browse the repository at this point in the history
…el (#1608)

Co-authored-by: Huon Wilson <huon@exoflare.io>
Co-authored-by: Manuel Ochoa <mochoa1127@gmail.com>
  • Loading branch information
3 people committed Oct 18, 2022
1 parent 18bee37 commit 648501b
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 62 deletions.
9 changes: 4 additions & 5 deletions aws_lambda_powertools/utilities/parser/models/ses.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from typing import List, Optional

from pydantic import BaseModel, Field
from pydantic.networks import EmailStr
from pydantic.types import PositiveInt

from ..types import Literal
Expand All @@ -21,7 +20,7 @@ class SesReceiptAction(BaseModel):
class SesReceipt(BaseModel):
timestamp: datetime
processingTimeMillis: PositiveInt
recipients: List[EmailStr]
recipients: List[str]
spamVerdict: SesReceiptVerdict
virusVerdict: SesReceiptVerdict
spfVerdict: SesReceiptVerdict
Expand All @@ -41,17 +40,17 @@ class SesMailCommonHeaders(BaseModel):
bcc: Optional[List[str]]
sender: Optional[List[str]]
reply_to: Optional[List[str]] = Field(None, alias="reply-to")
returnPath: EmailStr
returnPath: str
messageId: str
date: str
subject: str


class SesMail(BaseModel):
timestamp: datetime
source: EmailStr
source: str
messageId: str
destination: List[EmailStr]
destination: List[str]
headersTruncated: bool
headers: List[SesMailHeaders]
commonHeaders: SesMailCommonHeaders
Expand Down
6 changes: 3 additions & 3 deletions layer/layer/canary/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from importlib.metadata import version

import boto3
from pydantic import EmailStr
from pydantic import HttpUrl

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


# Model to check parser imports correctly, tests for pydantic and email-validator
# Model to check parser imports correctly, tests for pydantic
class OrderItem(BaseModel):
order_id: int
quantity: int
description: str
email: EmailStr
url: HttpUrl


# Tests for jmespath presence
Expand Down
64 changes: 15 additions & 49 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ python = "^3.7.4"
aws-xray-sdk = { version = "^2.8.0", optional = true }
fastjsonschema = { version = "^2.14.5", optional = true }
pydantic = { version = "^1.8.2", optional = true }
email-validator = { version = "^1.3.0", optional = true }
boto3 = { version = "^1.20.32", optional = true }

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

[tool.poetry.extras]
parser = ["pydantic", "email-validator"]
parser = ["pydantic"]
validation = ["fastjsonschema"]
tracer = ["aws-xray-sdk"]
all = ["pydantic", "email-validator", "aws-xray-sdk", "fastjsonschema"]
all = ["pydantic", "aws-xray-sdk", "fastjsonschema"]
# allow customers to run code locally without emulators (SAM CLI, etc.)
aws-sdk = ["boto3"]
[tool.coverage.run]
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ deps =
filelock
pytest-xdist
pydantic
email-validator

commands = python parallel_run_e2e.py

; If you ever encounter another parallel lock across interpreters
; pip install tox tox-poetry
; tox -p --parallel-live
; tox -p --parallel-live

0 comments on commit 648501b

Please sign in to comment.