From b2a536c41d713e0e03be60abe1e61b925a295c52 Mon Sep 17 00:00:00 2001 From: David Brochart Date: Wed, 1 Mar 2023 23:40:39 +0100 Subject: [PATCH] Dependency chain paths --- src/in_n_out/_store.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/in_n_out/_store.py b/src/in_n_out/_store.py index 3915bd1..e115ec9 100644 --- a/src/in_n_out/_store.py +++ b/src/in_n_out/_store.py @@ -802,7 +802,16 @@ def _exec(*args: P.args, **kwargs: P.kwargs) -> R: _injected_names, ) try: + path = [] + for k, v in bound.arguments.items(): + if hasattr(v, "_path"): + v._path.append(k) + v._path.insert(0, path) + else: + v._path = [path, k] result = func(**bound.arguments) + if result is not None: + result._path = path except TypeError as e: if "missing" not in e.args[0]: raise # pragma: no cover