Skip to content

Commit cfbe618

Browse files
committed
Fix changes after merge
1 parent 99aea3e commit cfbe618

File tree

6 files changed

+131
-705
lines changed

6 files changed

+131
-705
lines changed

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
authors = [
33
{name = "Federico Busetti", email = "[email protected]"},
44
]
5-
requires-python = "<3.14,>=3.9"
5+
requires-python = "<3.14,>=3.11"
66
name = "bootstrap-fastapi-service"
77
version = "0.1.0"
88
description = ""
@@ -14,20 +14,22 @@ dependencies = [
1414
"cloudevents-pydantic<1.0.0,>=0.0.3",
1515
"dependency-injector[pydantic]<5.0.0,>=4.41.0",
1616
"dramatiq[redis,watch]<2.0.0,>=1.17.1",
17-
"hiredis<4.0.0,>=3.1.0", # Recommended by dramatiq
17+
"hiredis<4.0.0,>=3.1.0", # Recommended by dramatiq
1818
"httpx>=0.23.0",
1919
"opentelemetry-distro[otlp]",
2020
"opentelemetry-instrumentation",
2121
"opentelemetry-instrumentation-httpx",
2222
"opentelemetry-instrumentation-sqlalchemy",
2323
"opentelemetry-instrumentor-dramatiq",
24+
"opentelemetry-instrumentation-faststream",
2425
"orjson<4.0.0,>=3.10.12",
2526
"pydantic<3.0.0,>=2.2.1",
2627
"pydantic-settings<3.0.0,>=2.0.3",
2728
"rich<14.0.0,>=13.2.0",
2829
"SQLAlchemy[asyncio,mypy]<3.0.0,>=2.0.0",
2930
"sqlalchemy-bind-manager",
3031
"structlog<25.1.1,>=25.1.0",
32+
"faststream>=0.5.34",
3133
]
3234

3335
[dependency-groups]

src/bootstrap/config.py

Lines changed: 0 additions & 80 deletions
This file was deleted.

src/common/config.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,19 @@ class AuthConfig(BaseModel):
1717
JWKS_URL: Optional[str] = None
1818

1919

20+
class EventConfig(BaseModel):
21+
REDIS_BROKER_URL: str = ""
22+
TOPIC: Optional[str] = None
23+
IS_PUBLISHER: bool = False
24+
IS_SUBSCRIBER: bool = False
25+
26+
2027
class AppConfig(BaseSettings):
2128
model_config = SettingsConfigDict(env_nested_delimiter="__")
2229

2330
APP_NAME: str = "bootstrap"
2431
AUTH: AuthConfig = AuthConfig()
32+
EVENTS: EventConfig = EventConfig()
2533
DRAMATIQ: DramatiqConfig = DramatiqConfig()
2634
DEBUG: bool = False
2735
ENVIRONMENT: TYPE_ENVIRONMENT = "local"

src/common/faststream.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
# from faststream.redis.publisher.asyncapi import AsyncAPIPublisher
1111
from opentelemetry.instrumentation.faststream import RedisOtelMiddleware
1212

13-
from bootstrap.config import EventConfig
13+
from common.config import EventConfig
1414
from domains import event_registry
15+
from event_consumer import register_subscribers
1516

1617
logger = structlog.getLogger(__name__)
1718

src/event_consumer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from opentelemetry.sdk.trace.export import BatchSpanProcessor
1818

1919
from alembic.env import logger
20-
from bootstrap import AppConfig, application_init
20+
from common import AppConfig, application_init
2121
from domains import event_registry
2222
from domains.books.events import BookCreatedV1, BookCreatedV1Data
2323

0 commit comments

Comments
 (0)