Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lilya version #438

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions esmerald/encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from lilya._internal._encoders import json_encoder as json_encoder # noqa
from lilya._utils import is_class_and_subclass
from lilya.encoders import (
ENCODER_TYPES as ENCODER_TYPES, # noqa
ENCODER_TYPES as LILYA_ENCODER_TYPES, # noqa
Encoder as LilyaEncoder, # noqa
register_encoder as register_encoder, # noqa
)
Expand All @@ -19,9 +19,10 @@

T = TypeVar("T")

ENCODER_TYPES = LILYA_ENCODER_TYPES.get()

class Encoder(LilyaEncoder[T]):

class Encoder(LilyaEncoder[T]):
def is_type(self, value: Any) -> bool:
"""
Function that checks if the function is
Expand All @@ -44,7 +45,6 @@ def encode(self, annotation: Any, value: Any) -> Any:


class MsgSpecEncoder(Encoder):

def is_type(self, value: Any) -> bool:
return isinstance(value, Struct) or is_class_and_subclass(value, Struct)

Expand All @@ -60,7 +60,6 @@ def encode(self, annotation: Any, value: Any) -> Any:


class PydanticEncoder(Encoder):

def is_type(self, value: Any) -> bool:
return isinstance(value, BaseModel) or is_class_and_subclass(value, BaseModel)

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ dependencies = [
"email-validator >=2.2.0,<3.0.0",
"itsdangerous>=2.1.2,<3.0.0",
"jinja2>=3.1.2,<4.0.0",
"lilya>=0.10.0",
"lilya>=0.11.1",
"loguru>=0.7.0,<0.8.0",
"pydantic>=2.9.1,<3.0.0",
"pydantic-settings>=2.0.0,<3.0.0",
Expand Down Expand Up @@ -127,7 +127,7 @@ docs = [
"a2wsgi>=1.9.0",
"griffe-typingdoc>=0.2.2",
"httpx>=0.25.0",
"lilya>=0.9.1",
"lilya>=0.11.1",
"mkautodoc>=0.2.0",
"mkdocs>=1.6.0",
"mkdocs-material>=9.5.25",
Expand Down