1515
1616from fastapi import APIRouter , Depends , FastAPI
1717
18- from .. import dependencies
1918from ..middleware import ASGIMiddleware
2019
2120_logger = logging .getLogger (__name__ )
@@ -311,9 +310,12 @@ def _get_app(self) -> FastAPI:
311310 return app
312311
313312 def _get_app_dependencies_overrides (self ) -> dict [Callable , Callable ]:
313+ # Import here to avoid circular import while waiting for lazy imports
314+ from ..dependencies import company_id , fastapi_endpoint_id
315+
314316 return {
315- dependencies . fastapi_endpoint_id : partial (lambda a : a , self .id ),
316- dependencies . company_id : partial (lambda a : a , self .company_id .id ),
317+ fastapi_endpoint_id : partial (lambda a : a , self .id ),
318+ company_id : partial (lambda a : a , self .company_id .id ),
317319 }
318320
319321 def _prepare_fastapi_app_params (self ) -> dict [str , Any ]:
@@ -338,7 +340,10 @@ def _get_fastapi_app_middlewares(self) -> list[Middleware]:
338340
339341 def _get_fastapi_app_dependencies (self ) -> list [Depends ]:
340342 """Return the dependencies to use for the fastapi app."""
341- return [Depends (dependencies .accept_language )]
343+ # Import here to avoid circular import too
344+ from ..dependencies import accept_language
345+
346+ return [Depends (accept_language )]
342347
343348 # test utility
344349 @api .model
0 commit comments