Skip to content

Commit

Permalink
chore: bump package versions (#1285)
Browse files Browse the repository at this point in the history
* chore: bump package versions

* bug fix
  • Loading branch information
davorrunje authored Mar 4, 2024
1 parent e37721f commit 64f4b52
Show file tree
Hide file tree
Showing 58 changed files with 273 additions and 515 deletions.
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"filename": "docs/docs/en/release.md",
"hashed_secret": "35675e68f4b5af7b995d9205ad0fc43842f16450",
"is_verified": false,
"line_number": 676,
"line_number": 689,
"is_secret": false
}
],
Expand Down Expand Up @@ -163,5 +163,5 @@
}
]
},
"generated_at": "2024-02-27T08:00:31Z"
"generated_at": "2024-03-04T15:19:29Z"
}
2 changes: 1 addition & 1 deletion docs/docs/en/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ hide:

### What's Changed
* Update Release Notes for 0.4.4 by @faststream-release-notes-updater in [#1260](https://github.com/airtai/faststream/pull/1260){.external-link target="_blank"}
* Removed unused pytest dependecy from redis/schemas.py by [@ashambalev](https://github.com/ashambalev){.external-link target="_blank"} in [#1261](https://github.com/airtai/faststream/pull/1261){.external-link target="_blank"}
* Removed unused pytest dependency from redis/schemas.py by [@ashambalev](https://github.com/ashambalev){.external-link target="_blank"} in [#1261](https://github.com/airtai/faststream/pull/1261){.external-link target="_blank"}
* chore: bumped package versions by [@davorrunje](https://github.com/davorrunje){.external-link target="_blank"} in [#1270](https://github.com/airtai/faststream/pull/1270){.external-link target="_blank"}
* fix (#1263): correct AsyncAPI schema in descriminator case by [@Lancetnik](https://github.com/Lancetnik){.external-link target="_blank"} in [#1272](https://github.com/airtai/faststream/pull/1272){.external-link target="_blank"}

Expand Down
1 change: 1 addition & 0 deletions faststream/__about__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Simple and fast framework to create message brokers based microservices."""

__version__ = "0.4.6"


Expand Down
1 change: 1 addition & 0 deletions faststream/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""CLI entry point to FastStream library."""

import warnings

from faststream.cli.main import cli
Expand Down
12 changes: 6 additions & 6 deletions faststream/asyncapi/schema/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ class Message(BaseModel):
# examples
# traits

tags: Optional[
List[Union[Tag, Dict[str, Any]]]
] = None # TODO: weird TagDict behavior
externalDocs: Optional[
Union[ExternalDocs, Dict[str, Any]]
] = None # TODO: weird ExternalDocsDict behavior
tags: Optional[List[Union[Tag, Dict[str, Any]]]] = (
None # TODO: weird TagDict behavior
)
externalDocs: Optional[Union[ExternalDocs, Dict[str, Any]]] = (
None # TODO: weird ExternalDocsDict behavior
)

if PYDANTIC_V2:
model_config = {"extra": "allow"}
Expand Down
18 changes: 6 additions & 12 deletions faststream/broker/fastapi/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,29 +373,25 @@ async def start_broker_lifespan(
def after_startup(
self,
func: Callable[[AppType], Mapping[str, Any]],
) -> Callable[[AppType], Mapping[str, Any]]:
...
) -> Callable[[AppType], Mapping[str, Any]]: ...

@overload
def after_startup(
self,
func: Callable[[AppType], Awaitable[Mapping[str, Any]]],
) -> Callable[[AppType], Awaitable[Mapping[str, Any]]]:
...
) -> Callable[[AppType], Awaitable[Mapping[str, Any]]]: ...

@overload
def after_startup(
self,
func: Callable[[AppType], None],
) -> Callable[[AppType], None]:
...
) -> Callable[[AppType], None]: ...

@overload
def after_startup(
self,
func: Callable[[AppType], Awaitable[None]],
) -> Callable[[AppType], Awaitable[None]]:
...
) -> Callable[[AppType], Awaitable[None]]: ...

def after_startup(
self,
Expand Down Expand Up @@ -426,15 +422,13 @@ def after_startup(
def on_broker_shutdown(
self,
func: Callable[[AppType], None],
) -> Callable[[AppType], None]:
...
) -> Callable[[AppType], None]: ...

@overload
def on_broker_shutdown(
self,
func: Callable[[AppType], Awaitable[None]],
) -> Callable[[AppType], Awaitable[None]]:
...
) -> Callable[[AppType], Awaitable[None]]: ...

def on_broker_shutdown(
self,
Expand Down
6 changes: 3 additions & 3 deletions faststream/broker/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ def __call__(
TypeError: If `func` is not callable.
"""
handler_call: HandlerCallWrapper[
MsgType, P_HandlerParams, T_HandlerReturn
] = HandlerCallWrapper(func)
handler_call: HandlerCallWrapper[MsgType, P_HandlerParams, T_HandlerReturn] = (
HandlerCallWrapper(func)
)
handler_call._publishers.append(self)
self.calls.append(handler_call._original_call)
return handler_call
Expand Down
3 changes: 1 addition & 2 deletions faststream/confluent/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
class ConsumerProtocol(Protocol):
"""A protocol for Kafka consumers."""

async def commit(self) -> None:
...
async def commit(self) -> None: ...


class FakeConsumer:
Expand Down
3 changes: 1 addition & 2 deletions faststream/kafka/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
class ConsumerProtocol(Protocol):
"""A protocol for Kafka consumers."""

async def commit(self) -> None:
...
async def commit(self) -> None: ...


class FakeConsumer:
Expand Down
6 changes: 2 additions & 4 deletions faststream/nats/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ def __init__(self, is_js: bool) -> None:
@overload
async def parse_message(
self, message: List[Msg], *, path: Optional[AnyDict] = None
) -> StreamMessage[List[Msg]]:
...
) -> StreamMessage[List[Msg]]: ...

@overload
async def parse_message(
self, message: Msg, *, path: Optional[AnyDict] = None
) -> StreamMessage[Msg]:
...
) -> StreamMessage[Msg]: ...

async def parse_message(
self, message: Union[Msg, List[Msg]], *, path: Optional[AnyDict] = None
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ devdocs = [
"mkdocs-material==9.5.11",
"mkdocs-static-i18n==1.2.0",
"mdx-include==1.4.2",
"mkdocstrings[python]==0.24.0",
"mkdocstrings[python]==0.24.1",
"mkdocs-literate-nav==0.6.1",
"mkdocs-git-revision-date-localized-plugin==1.2.4",
"mike==2.0.0", # versioning
"mkdocs-minify-plugin==0.7.2",
"mkdocs-minify-plugin==0.8.0",
"mkdocs-macros-plugin==1.0.5", # includes with variables
"mkdocs-glightbox==0.3.7", # img zoom
"pillow==10.2.0",
Expand All @@ -107,13 +107,13 @@ lint = [
"types-docutils",
"confluent-kafka-stubs; python_version >= '3.11'",
"mypy==1.8.0",
"ruff==0.2.1",
"ruff==0.3.0",
"bandit==1.7.7",
"semgrep==1.62.0",
]

test-core = [
"coverage[toml]==7.4.1",
"coverage[toml]==7.4.3",
"pytest==8.0.1",
"pytest-asyncio==0.23.5",
"dirty-equals==0.7.1.post0",
Expand All @@ -128,7 +128,7 @@ testing = [
"httpx==0.27.0",
"PyYAML==6.0.1",
"watchfiles==0.21.0",
"email-validator==2.1.0.post1",
"email-validator==2.1.1",
]

dev = [
Expand Down
56 changes: 19 additions & 37 deletions tests/asyncapi/base/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ def test_custom_naming(self):
broker = self.broker_class()

@broker.subscriber("test", title="custom_name", description="test description")
async def handle(msg):
...
async def handle(msg): ...

schema = get_app_schema(self.build_app(broker)).to_jsonable()
key = tuple(schema["channels"].keys())[0] # noqa: RUF015
Expand All @@ -54,8 +53,7 @@ def test_no_type(self):
broker = self.broker_class()

@broker.subscriber("test")
async def handle(msg):
...
async def handle(msg): ...

schema = get_app_schema(self.build_app(broker)).to_jsonable()

Expand All @@ -69,8 +67,7 @@ def test_simple_type(self):
broker = self.broker_class()

@broker.subscriber("test")
async def handle(msg: int):
...
async def handle(msg: int): ...

schema = get_app_schema(self.build_app(broker)).to_jsonable()

Expand All @@ -85,8 +82,7 @@ def test_simple_optional_type(self):
broker = self.broker_class()

@broker.subscriber("test")
async def handle(msg: Optional[int]):
...
async def handle(msg: Optional[int]): ...

schema = get_app_schema(self.build_app(broker)).to_jsonable()

Expand All @@ -110,8 +106,7 @@ def test_simple_type_with_default(self):
broker = self.broker_class()

@broker.subscriber("test")
async def handle(msg: int = 1):
...
async def handle(msg: int = 1): ...

schema = get_app_schema(self.build_app(broker)).to_jsonable()

Expand All @@ -129,8 +124,7 @@ def test_multi_args_no_type(self):
broker = self.broker_class()

@broker.subscriber("test")
async def handle(msg, another):
...
async def handle(msg, another): ...

schema = get_app_schema(self.build_app(broker)).to_jsonable()

Expand All @@ -152,8 +146,7 @@ def test_multi_args_with_type(self):
broker = self.broker_class()

@broker.subscriber("test")
async def handle(msg: str, another: int):
...
async def handle(msg: str, another: int): ...

schema = get_app_schema(self.build_app(broker)).to_jsonable()

Expand All @@ -175,8 +168,7 @@ def test_multi_args_with_default(self):
broker = self.broker_class()

@broker.subscriber("test")
async def handle(msg: str, another: Optional[int] = None):
...
async def handle(msg: str, another: Optional[int] = None): ...

schema = get_app_schema(self.build_app(broker)).to_jsonable()

Expand Down Expand Up @@ -215,8 +207,7 @@ class User(pydantic.BaseModel):
broker = self.broker_class()

@broker.subscriber("test")
async def handle(user: User):
...
async def handle(user: User): ...

schema = get_app_schema(self.build_app(broker)).to_jsonable()

Expand Down Expand Up @@ -247,8 +238,7 @@ class User(pydantic.BaseModel):
broker = self.broker_class()

@broker.subscriber("test")
async def handle(user: User):
...
async def handle(user: User): ...

schema = get_app_schema(self.build_app(broker)).to_jsonable()

Expand Down Expand Up @@ -286,8 +276,7 @@ class User(pydantic.BaseModel):
broker = self.broker_class()

@broker.subscriber("test")
async def handle(user: User, description: str = ""):
...
async def handle(user: User, description: str = ""): ...

schema = get_app_schema(self.build_app(broker)).to_jsonable()

Expand Down Expand Up @@ -343,8 +332,7 @@ class Config:
broker = self.broker_class()

@broker.subscriber("test")
async def handle(user: User):
...
async def handle(user: User): ...

schema = get_app_schema(self.build_app(broker)).to_jsonable()

Expand Down Expand Up @@ -374,12 +362,10 @@ class User(pydantic.BaseModel):
"test",
filter=lambda m: m.content_type == "application/json",
)
async def handle(id: int):
...
async def handle(id: int): ...

@broker.subscriber("test")
async def handle_default(msg):
...
async def handle_default(msg): ...

schema = get_app_schema(self.build_app(broker)).to_jsonable()

Expand Down Expand Up @@ -410,8 +396,7 @@ def dep2(name2: str):
message = self.dependency_builder(dep)

@broker.subscriber("test", dependencies=dependencies)
async def handle(id: int, message=message):
...
async def handle(id: int, message=message): ...

schema = get_app_schema(self.build_app(broker)).to_jsonable()

Expand Down Expand Up @@ -445,12 +430,11 @@ class Sub(pydantic.BaseModel):
broker = self.broker_class()

@broker.subscriber("test")
async def handle(user: descriminator):
...
async def handle(user: descriminator): ...

schema = get_app_schema(self.build_app(broker)).to_jsonable()

key = tuple(schema["components"]["messages"].keys())[0]
key = next(iter(schema["components"]["messages"].keys()))
assert key == IsStr(regex=r"test[\w:]*:Handle:Message")
assert schema["components"] == {
"messages": {
Expand Down Expand Up @@ -498,8 +482,7 @@ async def msg(
title="Perfect",
examples=[1],
),
):
...
): ...

schema = get_app_schema(self.build_app(broker)).to_jsonable()

Expand All @@ -521,8 +504,7 @@ def test_ignores_custom_field(self):
broker = self.broker_class()

@broker.subscriber("test")
async def handle(id: int, user: Optional[str] = None, message=Context()):
...
async def handle(id: int, user: Optional[str] = None, message=Context()): ...

schema = get_app_schema(self.build_app(broker)).to_jsonable()

Expand Down
3 changes: 1 addition & 2 deletions tests/asyncapi/base/fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ async def test_fastapi_asyncapi_routes(self):
broker = self.broker_class(schema_url="/asyncapi_schema")

@broker.subscriber("test")
async def handler():
...
async def handler(): ...

app = FastAPI(lifespan=broker.lifespan_context)
app.include_router(broker)
Expand Down
Loading

0 comments on commit 64f4b52

Please sign in to comment.