summaryrefslogtreecommitdiff
path: root/src/buildstream/_artifact.py
diff options
context:
space:
mode:
authorTristan van Berkom <tristan@codethink.co.uk>2020-08-30 15:57:13 +0900
committerTristan van Berkom <tristan@codethink.co.uk>2020-09-04 18:22:38 +0900
commit1a3e4e89fc86b29342c9ec62ca8915b6eae084d2 (patch)
treed0e88bcc0fe25618306e93a3354026776bb9587b /src/buildstream/_artifact.py
parent97812cbb7d295cc3d270be9205cbc12313215028 (diff)
downloadbuildstream-1a3e4e89fc86b29342c9ec62ca8915b6eae084d2.tar.gz
element.py: Hide dependencies which are irrelevant to the Element
This is a large breaking change, a summary of the changes are that: * The Scope type is now private, since Element plugins do not have the choice to view any other scopes. * Element.dependencies() API change Now it accepts a "selection" (sequence) of dependency elements, so that Element.dependencies() can iterate over a collection of dependencies, ensuring that we iterate over every element only once even when we need to iterate over multiple element's dependencies. The old API is moved to Element._dependencies() and still used internally. * Element.stage_dependency_artifacts() API change This gets the same treatment as Element.dependencies(), and the old API is also preserved as Element._stage_dependency_artifacts(), so that the CLI can stage things for `bst artifact checkout` and such. * Element.search() API change The Scope argument is removed, and the old API is preserved as Element._search() temporarily, until we can remove this completely.
Diffstat (limited to 'src/buildstream/_artifact.py')
-rw-r--r--src/buildstream/_artifact.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/buildstream/_artifact.py b/src/buildstream/_artifact.py
index 1df665c14..048f09cc6 100644
--- a/src/buildstream/_artifact.py
+++ b/src/buildstream/_artifact.py
@@ -33,7 +33,7 @@ import os
from ._protos.buildstream.v2.artifact_pb2 import Artifact as ArtifactProto
from . import _yaml
from . import utils
-from .types import Scope
+from .types import _Scope
from .storage._casbaseddirectory import CasBasedDirectory
@@ -181,7 +181,7 @@ class Artifact:
size += public_data_digest.size_bytes
# store build dependencies
- for e in element._dependencies(Scope.BUILD):
+ for e in element._dependencies(_Scope.BUILD):
new_build = artifact.build_deps.add()
new_build.project_name = e.project_name
new_build.element_name = e.name
@@ -363,7 +363,7 @@ class Artifact:
# get_dependency_artifact_names()
#
- # Retrieve the artifact names of all of the dependencies in Scope.BUILD
+ # Retrieve the artifact names of all of the dependencies in _Scope.BUILD
#
# Returns:
# (list [str]): A list of refs of all build dependencies in staging order.