Ididi

Latest version: v1.4.2

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

Scan your dependencies

Page 1 of 10

1.4.2

Function as Dependency

a function with its return type Annotated by `Ignore` is considered a pure function dependency, instead of a factory.


python
dg.node
def get_user(session: Session, token: Token) -> Ignore[User]:
...


which means that, `get_user` won't be used to resolve `User`.

python
def validate_admin(user: Annotated[User, get_user])->Ignore[Any]:
...

1.4.1

we should take a smarter approach with `ignore`, for node configured with ignore,
we don't put them in node's dependencies.
This would be more efficient and make more sense.

python
def test_ignore_dependences():
dg = DependencyGraph()

class User:
def __init__(self, name: Ignore[str]): ...

dg.node(User)

assert len(dg.nodes[User].dependencies) == 0

1.4.0

This minor focus on a small refactor on `Scope`, we like the idea that `Scope` is a temporary view of its parent `Graph`, so following change is made:

- both resource and non-resource instances created in scope will stay in the scope
- when a graph create a scope, it shares a copy of its resolved singletons and registered singletons, scope can read them, but can not modify them.

This gives a better separation between `Graph` and `Scope`.

1.3.6

- Fix: `Graph.entry` no longer uses existing scope, instead, always create a new scope

1.3.5

- a quick bug fix, where in 1.3.4, registered_singleton is not shared between graph and scope.

The general rule is that scope can access registered singletons and resolved instances but not vice versa.

1.3.4

- refactor `Scope` and `Graph` to avoid circular reference,

Page 1 of 10

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.