Ididi

Latest version: v1.4.2

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

Scan your dependencies

Page 7 of 10

0.104534

This make functions that does not depends on resource 4-5 times faster than 1.1.2
Fix:

- :sparkles: fix a bug where when a dependent with is registered with `DependencyGraph.register_dependnet`, it will still be statically resolved.

0.099846

0.089221

0.000558

0.000139

renaming

- rename `DependencyGraph` to `Graph`
- rename `DependencyGraph.static_resolve` to `Graph.analyze`
- rename `DependencyGraph.static_resolve_all` to `Graph.analyze_nodes`

Original names are kept as alias to new names to avoid breaking changes


typing support

- support Unpack
py
class DataBase: ...
class Cache: ...
class Config: ...

class KWARGS(TypedDict):
db: DataBase
cache: Cache

class Extra(KWARGS):
config: Config

class Repo:
def __init__(self, **kwargs: Unpack[KWARGS]) -> None:
self.db = kwargs["db"]
self.cache = kwargs["cache"]

class SubRepo(Repo):
def __init__(self, **kwargs: Unpack[Extra]):
super().__init__(db=kwargs["db"], cache=kwargs["cache"])
self.config = kwargs["config"]

def test_resolve_unpack():
dg = Graph()
repo = dg.resolve(Repo)
assert isinstance(repo.db, DataBase)
assert isinstance(repo.cache, Cache)
subrepo = dg.resolve(SubRepo)
assert isinstance(subrepo.config, Config)


- support Literal

py
def test_resolve_literal():
dg = Graph()

class User:
def __init__(self, name: Literal["user"] = "user"):
self.name = name

u = dg.resolve(User)
assert u.name == "user"



Features

py
Graph.remove_singleton(self, dependent_type: type) -> None:
"Remove the registered singleton from current graph, return if not found"

Graph.remove_dependent(self, dependent_type: type) -> None
"Remove the dependent from current graph, return if not found"

0.2.8

FIX:

Adding a temporary fix to missing annotation error, which would be removed in the future.

Example:

python
class Config:
def __init__(self, a):
self.a = a

dag.node
def config_factory() -> Config:
return Config(a=1)

class Service:
def __init__(self, config: Config):
self.config = config

dg.resolve(Service)


This would previously raise `NodeCreationError`, with root cause being `MissingAnnotationErro`, now being fixed.

Page 7 of 10

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.