MCPcopy
hub / github.com/aws/aws-cli / _create_record_file

Function _create_record_file

backends/pep517.py:273–291  ·  view source on GitHub ↗
(base_dir, dist_info_dir)

Source from the content-addressed store, hash-verified

271
272
273def _create_record_file(base_dir, dist_info_dir):
274 entries = []
275 for base, dirs, files in os.walk(base_dir):
276 dirs.sort()
277 for filename in sorted(files):
278 # Record file has its own special entry at the end
279 if filename == "RECORD":
280 continue
281 target = os.path.join(base, filename)
282 # Path entries in record file are unix style
283 path = os.path.relpath(target, base_dir).replace(os.sep, "/")
284 digest = _get_b64_sha256(target)
285 size = os.path.getsize(target)
286 record_entry = f"{path},sha256={digest},{size}"
287 entries.append(record_entry)
288 entries.append(f"{dist_info_dir}/RECORD,,")
289 record_path = os.path.join(base_dir, dist_info_dir, "RECORD")
290 with open(record_path, "w") as f:
291 f.write("\n".join(entries) + "\n")
292
293
294def _get_b64_sha256(path):

Callers 1

_inject_scriptsFunction · 0.70

Calls 3

_get_b64_sha256Function · 0.70
walkMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected