INNER CODE UNIT · Python
make_bytes
uxlfoundation/oneDAL · dev/release_tests/compare_release_trees.py:554
make_bytes = (make_root / path).read_bytes()
bazel_bytes = (bazel_root / path).read_bytes()
make_eol = line_ending_counts(make_bytes)
bazel_eol = line_ending_counts(bazel_bytes)
detail = f"Make={len(make_bytes)}B Bazel={len(bazel_bytes)}B"
if make_eol != bazel_eol:
detail += (
" EOL Make(crlf={},lf={},cr={}) Bazel(crlf={},lf={},cr={})"
.format(*make_eol, *bazel_eol)
)
# Same text once endings are normalised means the endings are the only
# difference; say so explicitly rather than making the reader infer it.
if make_bytes.replace(b"\r\n", b"\n") == bazel_bytes.replace(b"\r\n", b"\n"):
detail += " (line endings only)"
return detail
def text_mismatch_diff(make_root, bazel_root, path, context=1, max_lines=12):