-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update FastAPI to 0.112.2 (#1736)
* refactor: new FastAPI integration syntax * lint: fix confluent topic mypy * docs: generate API References * docs: fix FastAPI integration section * docs: make annotation private * chore: update FastAPI * lint: fix precommit * chore: trigger CI * chore: revert CI triggers --------- Co-authored-by: Lancetnik <[email protected]> Co-authored-by: Davor Runje <[email protected]>
- Loading branch information
1 parent
4944180
commit 79c7b78
Showing
42 changed files
with
108 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 6 additions & 14 deletions
20
docs/docs_src/integrations/fastapi/confluent/multiple_lifespan.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
from contextlib import asynccontextmanager | ||
|
||
from fastapi import FastAPI | ||
from faststream.confluent.fastapi import KafkaRouter | ||
|
||
core_router = KafkaRouter() | ||
nested_router = KafkaRouter() | ||
one_router = KafkaRouter() | ||
another_router = KafkaRouter() | ||
|
||
@asynccontextmanager | ||
async def lifespan(app: FastAPI): | ||
async with ( | ||
core_router.lifespan_context(app), | ||
nested_router.lifespan_context(app), | ||
): | ||
yield | ||
... | ||
|
||
app = FastAPI(lifespan=lifespan) | ||
app.include_router(core_router) | ||
app.include_router(nested_router) | ||
app = FastAPI() | ||
app.include_router(one_router) | ||
app.include_router(another_router) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 6 additions & 14 deletions
20
docs/docs_src/integrations/fastapi/kafka/multiple_lifespan.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
from contextlib import asynccontextmanager | ||
|
||
from fastapi import FastAPI | ||
from faststream.kafka.fastapi import KafkaRouter | ||
|
||
core_router = KafkaRouter() | ||
nested_router = KafkaRouter() | ||
one_router = KafkaRouter() | ||
another_router = KafkaRouter() | ||
|
||
@asynccontextmanager | ||
async def lifespan(app: FastAPI): | ||
async with ( | ||
core_router.lifespan_context(app), | ||
nested_router.lifespan_context(app), | ||
): | ||
yield | ||
... | ||
|
||
app = FastAPI(lifespan=lifespan) | ||
app.include_router(core_router) | ||
app.include_router(nested_router) | ||
app = FastAPI() | ||
app.include_router(one_router) | ||
app.include_router(another_router) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 6 additions & 14 deletions
20
docs/docs_src/integrations/fastapi/nats/multiple_lifespan.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
from contextlib import asynccontextmanager | ||
|
||
from fastapi import FastAPI | ||
from faststream.nats.fastapi import NatsRouter | ||
|
||
core_router = NatsRouter() | ||
nested_router = NatsRouter() | ||
one_router = NatsRouter() | ||
another_router = NatsRouter() | ||
|
||
@asynccontextmanager | ||
async def lifespan(app: FastAPI): | ||
async with ( | ||
core_router.lifespan_context(app), | ||
nested_router.lifespan_context(app), | ||
): | ||
yield | ||
... | ||
|
||
app = FastAPI(lifespan=lifespan) | ||
app.include_router(core_router) | ||
app.include_router(nested_router) | ||
app = FastAPI() | ||
app.include_router(one_router) | ||
app.include_router(another_router) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 6 additions & 14 deletions
20
docs/docs_src/integrations/fastapi/rabbit/multiple_lifespan.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
from contextlib import asynccontextmanager | ||
|
||
from fastapi import FastAPI | ||
from faststream.rabbit.fastapi import RabbitRouter | ||
|
||
core_router = RabbitRouter() | ||
nested_router = RabbitRouter() | ||
one_router = RabbitRouter() | ||
another_router = RabbitRouter() | ||
|
||
@asynccontextmanager | ||
async def lifespan(app: FastAPI): | ||
async with ( | ||
core_router.lifespan_context(app), | ||
nested_router.lifespan_context(app), | ||
): | ||
yield | ||
... | ||
|
||
app = FastAPI(lifespan=lifespan) | ||
app.include_router(core_router) | ||
app.include_router(nested_router) | ||
app = FastAPI() | ||
app.include_router(one_router) | ||
app.include_router(another_router) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 6 additions & 14 deletions
20
docs/docs_src/integrations/fastapi/redis/multiple_lifespan.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
from contextlib import asynccontextmanager | ||
|
||
from fastapi import FastAPI | ||
from faststream.redis.fastapi import RedisRouter | ||
|
||
core_router = RedisRouter() | ||
nested_router = RedisRouter() | ||
one_router = RedisRouter() | ||
another_router = RedisRouter() | ||
|
||
@asynccontextmanager | ||
async def lifespan(app: FastAPI): | ||
async with ( | ||
core_router.lifespan_context(app), | ||
nested_router.lifespan_context(app), | ||
): | ||
yield | ||
... | ||
|
||
app = FastAPI(lifespan=lifespan) | ||
app.include_router(core_router) | ||
app.include_router(nested_router) | ||
app = FastAPI() | ||
app.include_router(one_router) | ||
app.include_router(another_router) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.