'Return a set of artifact dependencies.
Args:
recursive: If True recurse into dependencies to find their dependencies.
depth: Used for limiting recursion depth.
Returns:
A set of strings containing the dependent artifact names.
Raises:
RuntimeError: If maximum recursion depth reached.'

def GetArtifactDependencies(self, recursive=False, depth=1):

    deps = set()
    for source in self.sources:
        if (source.type in (ArtifactSource.SourceType.ARTIFACT, ArtifactSource.SourceType.ARTIFACT_GROUP)):
            if source.attributes.GetItem('names'):
                deps.update(source.attributes.GetItem('names'))
    if (depth > 10):
        raise RuntimeError('Max    artifact    recursion    depth    reached.')
    deps_set = set(deps)
    if recursive:
        for dep in deps:
            artifact_obj = REGISTRY.GetArtifact(dep)
            new_dep = artifact_obj.GetArtifactDependencies(True, depth=(depth + 1))
            if new_dep:
                deps_set.update(new_dep)
    return deps_set
