Ejemplo n.º 1
0
def _resolve_deps(op, run, for_stage=False):
    resolved = run.get("resolved_deps") or {}
    for dep in op.deps or []:
        log.info("Resolving %s dependency", dep.resdef.name)
        resolved_sources = resolved.setdefault(dep.resdef.name, {})
        for source in dep.resdef.sources:
            if source.name in resolved_sources:
                log.info("Skipping %s because it's already resolved",
                         source.name)
                continue
            if for_stage and _is_operation_source(source):
                log.info("Skipping operation dependency %s for stage",
                         source.name)
                continue
            paths = op_dep.resolve_source(source, dep, run.dir)
            rel_paths = [os.path.relpath(path, run.dir) for path in paths]
            resolved_sources[source.name] = rel_paths
    run.write_attr("resolved_deps", resolved)
Ejemplo n.º 2
0
def _resolve_dep_source(source, dep, resolve_context, run):
    resolved_abs_paths = op_dep.resolve_source(source, dep, resolve_context)
    return [os.path.relpath(path, run.dir) for path in resolved_abs_paths]