bb: Use namedtuple for Task data
PATCH 1/1 bb: Use namedtuple for Task data
Task dependency data is becoming unwieldy with the number of indices it contains. Convert it to use a named tuple instead, which allows members to be indexed by a named property or an index (which allows it to retain backward compatibility).
Signed-off-by Joshua Watt <[email protected]>
--- bitbake/lib/bb/__init__.py | 12 ++++++++++ bitbake/lib/bb/runqueue.py | 45 +++++++++++++++++++++++--------------- 2 files changed, 39 insertions(+), 18 deletions(-)
bitbake/lib/bb/__init__.py +12 -0
@@ -36,6 +36,7 @@ class BBHandledException(Exception): import os import logging +from collections import namedtuple class NullHandler(logging.Handler):
@@ -227,3 +228,14 @@ def deprecate_import(current, modulename, fromlist, renames = None): setattr(sys.modules[current], newname, newobj) +TaskData = namedtuple("TaskData", [ + "pn", + "taskname", + "fn", + "deps", + "provides", + "taskhash", + "unihash", + "hashfn", + "taskhash_deps", +])
bitbake/lib/bb/runqueue.py +27 -18
65 lines not on this page · raw message
Signature · 1 line
2.43.2