add long_spec property to get fully enumerated spec string (#48389)
This commit is contained in:
parent
3932299768
commit
66e8523e14
@ -2052,6 +2052,20 @@ def traverse_edges(
|
||||
visited=visited,
|
||||
)
|
||||
|
||||
@property
|
||||
def long_spec(self):
|
||||
"""Returns a string of the spec with the dependencies completely
|
||||
enumerated."""
|
||||
root_str = [self.format()]
|
||||
sorted_dependencies = sorted(
|
||||
self.traverse(root=False), key=lambda x: (x.name, x.abstract_hash)
|
||||
)
|
||||
sorted_dependencies = [
|
||||
d.format("{edge_attributes} " + DEFAULT_FORMAT) for d in sorted_dependencies
|
||||
]
|
||||
spec_str = " ^".join(root_str + sorted_dependencies)
|
||||
return spec_str.strip()
|
||||
|
||||
@property
|
||||
def short_spec(self):
|
||||
"""Returns a version of the spec with the dependencies hashed
|
||||
@ -4165,15 +4179,7 @@ def __str__(self):
|
||||
if not self._dependencies:
|
||||
return self.format()
|
||||
|
||||
root_str = [self.format()]
|
||||
sorted_dependencies = sorted(
|
||||
self.traverse(root=False), key=lambda x: (x.name, x.abstract_hash)
|
||||
)
|
||||
sorted_dependencies = [
|
||||
d.format("{edge_attributes} " + DEFAULT_FORMAT) for d in sorted_dependencies
|
||||
]
|
||||
spec_str = " ^".join(root_str + sorted_dependencies)
|
||||
return spec_str.strip()
|
||||
return self.long_spec
|
||||
|
||||
@property
|
||||
def colored_str(self):
|
||||
|
Loading…
Reference in New Issue
Block a user