[Python] Feat: Dependency Injection, Improved error handling (#2067)

* feat: first pass at dependency injection

* feat: add DI example + tests

* feat: finish up tests

* feat: docs

* chore: gen

* chore: lint

* chore: changelog + ver

* fix: split up paragraphs

* refactor: improve impl

* chore: gen

* feat: inject input + ctx into deps

* chore: gen

* [Python] Feat: More use of `logger.exception` (#2069)

* feat: add more instances of `logger.exception`

* chore: ver

* chore: changelog

* fix: one more error log

* chore: gen

* chore: gen

* chore: lint

* fix: improve shutdown

* chore: changelog

* unwind: exit handler

* feat: task run error

* feat: improve error serde with more context

* chore: changelog

* fix: changelog

* chore: gen

* fix: rm celpy + lark dep, casing issues

* chore: changelog

* fix: respect log levels over the API

* fix: changelog

* refactor: rename log forwarder

* fix: circular import
This commit is contained in:
matt
2025-08-11 23:10:44 -04:00
committed by GitHub
parent 8a0e88ac48
commit c8d5144ed4
47 changed files with 1082 additions and 272 deletions
+12
View File
@@ -15,6 +15,13 @@ from examples.concurrency_workflow_level.worker import (
from examples.conditions.worker import task_condition_workflow
from examples.dag.worker import dag_workflow
from examples.dedupe.worker import dedupe_child_wf, dedupe_parent_wf
from examples.dependency_injection.worker import (
async_task_with_dependencies,
di_workflow,
durable_async_task_with_dependencies,
durable_sync_task_with_dependencies,
sync_task_with_dependencies,
)
from examples.durable.worker import durable_workflow, wait_for_sleep_twice
from examples.events.worker import event_workflow
from examples.fanout.worker import child_wf, parent_wf
@@ -61,6 +68,7 @@ def main() -> None:
sync_fanout_child,
non_retryable_workflow,
concurrency_workflow_level_workflow,
di_workflow,
lifespan_task,
simple,
simple_durable,
@@ -70,6 +78,10 @@ def main() -> None:
webhook,
return_exceptions_task,
wait_for_sleep_twice,
async_task_with_dependencies,
sync_task_with_dependencies,
durable_async_task_with_dependencies,
durable_sync_task_with_dependencies,
],
lifespan=lifespan,
)