Ididi

Latest version: v1.4.2

Safety actively analyzes 703125 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 10

1.1.6

Fix:

- fix a bug where if user menually decorate its async generator / sync factory with contextlib.asynccontextmanager / contextmanager, `DependencyNode.factory_type` would generated as `function`.

.e.g:

py
from typing import AsyncGenerator
from contextlib import asynccontextmanager

asynccontextmanager
async def get_client() -> AsyncGenerator[Client, None]:
client = Client()
try:
yield client
finally:
await client.close()


- improvement

- use a dedicate ds to hold singleton dependent,
- improve error message for missing annotation / unresolvable dependency

1.1.5

Fix:

- previously only resource itself will be managed by scope, now if a dependnet depends on a resource, it will also be managed by scope.

1.1.4

Improvements:

- Add `DependencyGraph.should_be_scoped` api to check if a dependent type contains any resource dependency, and thus should be scoped. this is particularly useful when user needs to (dynamically) decide whether they should create the resource in a scope.

Fix:

- previously entry only check if any of its direct dependency is rousource or not, this will cause bug when any of its indirect dependencies is a resource, raise OutOfScope Exception

1.1.3

bash

1.1.2

bash

1.1.1

- remove `static_resolve` config from DependencyGraph
- remove `factory` method frmo DependencyGraph
- add a new `self_inejct` config to DependencyGraph
- add `register_dependent` config to DependencyGraph, SyncScope, AsyncScope
- inject now supports both as annotated annotation and as default value, as well as nested annotated annotation

py
class APP:
def __init__(self, graph: DependencyGraph):
self._graph = graph
self._graph.register_dependent(self)

dg = DependencygGraph()
app = APP(graph)


app.register
async def login(app: APP):
assert app is app

Page 4 of 10

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.