Skip to content

2.1.0

Latest

Choose a tag to compare

@github-actions github-actions released this 13 Jul 20:05
13f48a7

modern-di-celery 2.1.0 — adopt the modern-di integration kit

Maintenance release. No public API changeFromDI, inject,
DITask, setup_di, and fetch_di_container keep their signatures and
behavior. Swaps this package's hand-rolled FromDI marker, its
parse/resolve pair, and the __modern_di_injected__ double-wrap guard for
the shared primitives in
modern_di.integrations,
shipped in
modern-di 2.28.0.
Ninth of 13 planned adapter conversions across the modern-di ecosystem
(after
modern-di-starlette 2.2.0,
modern-di-fastapi 2.10.0,
modern-di-litestar 2.13.0,
modern-di-aiohttp 2.2.0,
modern-di-flask 2.1.0,
modern-di-faststream 2.10.0,
modern-di-typer 2.3.0,
and
modern-di-grpc 2.1.0).
Like typer, Celery has no connection/context object — a task invocation
carries no framework request — so this is a Layer-2-only conversion.
Unlike typer, this repo uses is_injected/mark_injected: DITask's
existing double-wrap guard maps directly onto the kit's formalized
primitives.

Internal refactors

  • _FromDI is gone; FromDI = integrations.from_di.
  • inject now calls integrations.parse_markers directly
    _parse_inject_params is deleted entirely, its body having been an exact
    duplicate.
  • Resolution goes through integrations.resolve_markers; the double-wrap
    guard uses integrations.mark_injected/integrations.is_injected

    (DITask.__init__ and both of inject's marking points).
  • The task-specific mechanism — the *args/**kwargs decoration-time
    TypeError guard, by-name signature binding, and the deliberate
    non-use of functools.wraps — is preserved exactly unchanged; none of
    it is part of the kit.
  • Dead imports removed: dataclasses, providers, T_co.
  • architecture/dependency-injection.md's "Resolution" and "DITask"
    sections promoted to describe the new internals.

Packaging

  • Bumps the modern-di floor to >=2.28,<3.

Downstream

No action needed — the public API (FromDI, inject, DITask,
setup_di, fetch_di_container) is unchanged. Upgrading only requires
modern-di>=2.28.0.

Internals

  • 100% line coverage; ruff, ty clean across Python 3.10–3.14.
  • Built via subagent-driven-development: 4 planned tasks, each with an
    independent spec+quality review; a whole-branch review before merge.