Mark exactly which parameters to inject with Provide[T]. Everything else is left for the caller — so it works with Django, Flask, Dramatiq, or any framework without interfering with their signatures.
from django.http import HttpRequest, HttpResponse from pysyringe import Container, Provide from myapp.domain import CalendarInterface from myapp.infra import Calendar container = Container() container.alias(CalendarInterface, Calendar) @container.inject def get_now( request: HttpRequest, calendar: Provide[CalendarInterface], ) -> HttpResponse: return HttpResponse(calendar.now().isoformat())