MCPcopy Create free account
hub / github.com/acking-you/static_flow / _lock_packages

Function _lock_packages

scripts/ci_affected.py:177–197  ·  view source on GitHub ↗

Parse Cargo.lock at `rev`. Returns (format_version, {id: fingerprint}, {id: deps_tuple}) where id = (name, version, source-or-None), or None when the lock cannot be read/parsed at that revision.

(rev)

Source from the content-addressed store, hash-verified

175 f in CROSS_EXACT
176 or any(f.startswith(p) for p in CROSS_PREFIX)
177 or Path(f).name.startswith("rust-toolchain")
178 )
179
180
181def _toml_at(rev, path):
182 res = run(["git", "show", f"{rev}:{path}"])
183 if res.returncode != 0:
184 return None
185 try:
186 return tomllib.loads(res.stdout)
187 except tomllib.TOMLDecodeError:
188 return None
189
190
191def _without_workspace_members(manifest):
192 stripped = deepcopy(manifest)
193 workspace = stripped.get("workspace")
194 if isinstance(workspace, dict):
195 workspace.pop("members", None)
196 return stripped
197
198
199def root_manifest_change_is_workspace_members_only(base, head):
200 mb = run(["git", "merge-base", base, head])

Callers 1

lock_affected_membersFunction · 0.85

Calls 2

runFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected