summaryrefslogtreecommitdiff
path: root/src/buildstream/element.py
diff options
context:
space:
mode:
authorTristan van Berkom <tristan@codethink.co.uk>2020-08-30 18:41:48 +0900
committerbst-marge-bot <marge-bot@buildstream.build>2020-08-30 17:25:07 +0000
commitb758505b6f1d82d839cee4b870a7fa5a8ce7422b (patch)
tree9b49ecb988c018e64b88691282edfc11d860cf1a /src/buildstream/element.py
parentfd80d4903eb28845ca9a67d5730254d93dbd0c24 (diff)
downloadbuildstream-b758505b6f1d82d839cee4b870a7fa5a8ce7422b.tar.gz
Remove unused Scope argument from artifact name related APIs.tristan/artifact-dependency-names
Additionally, this reverts terminology back to calling these "artifact names", and not "artifact refs", which is a terminology which crept in from various underlying implementations. Summary of changes: * _artifact.py: - get_dependency_refs() renamed to get_dependency_artifact_names() - get_dependency_artifact_names() loses the Scope argument - Consequently, a huge and needless XXX comment is removed * _artifactelement.py: - _new_from_artifact_ref() renamed to _new_from_artifact_name() - get_dependency_refs() renamed to get_dependency_artifact_names() - get_dependency_artifact_names() loses the Scope argument * _project.py: - Now call _new_from_artifact_name() - Removes a legacy XXX comment which is not particularly relevant * element.py: - __get_dependency_refs() renamed to __get_dependency_artifact_names() - Adapt __get_last_build_artifact() to updated API names.
Diffstat (limited to 'src/buildstream/element.py')
-rw-r--r--src/buildstream/element.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index 4995f1f37..4b53aa3dd 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -2259,20 +2259,17 @@ class Element(Plugin):
if redundant_ref is not None:
self.__redundant_source_refs.append((source, redundant_ref))
- # __get_dependency_refs()
+ # __get_dependency_artifact_names()
#
- # Retrieve the artifact refs of the element's dependencies
- #
- # Args:
- # scope (Scope): The scope of dependencies
+ # Retrieve the artifact names of all of the dependencies in Scope.BUILD
#
# Returns:
# (list [str]): A list of refs of all dependencies in staging order.
#
- def __get_dependency_refs(self, scope):
+ def __get_dependency_artifact_names(self):
return [
os.path.join(dep.project_name, _get_normal_name(dep.name), dep._get_cache_key())
- for dep in self.dependencies(scope)
+ for dep in self.dependencies(Scope.BUILD)
]
# __get_last_build_artifact()
@@ -2305,8 +2302,8 @@ class Element(Plugin):
# Don't perform an incremental build if there has been a change in
# build dependencies.
- old_dep_refs = artifact.get_dependency_refs(Scope.BUILD)
- new_dep_refs = self.__get_dependency_refs(Scope.BUILD)
+ old_dep_refs = artifact.get_dependency_artifact_names()
+ new_dep_refs = self.__get_dependency_artifact_names()
if old_dep_refs != new_dep_refs:
return None