def hash_exp(stages: Iterable["PipelineStage"]) -> str: exp_data = {} for stage in stages: if isinstance(stage, PipelineStage): exp_data.update(to_lockfile(stage)) return dict_sha256(exp_data)
def _get_cache_hash(cache, key=False): if key: cache["outs"] = [out["path"] for out in cache.get("outs", [])] return dict_sha256(cache)
def test_dict_sha256(d, sha): assert dict_sha256(d) == sha
def hash_exp(stages): exp_data = {} for stage in stages: exp_data.update(to_lockfile(stage)) return dict_sha256(exp_data)