MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_module_diff_stat

Function get_module_diff_stat

scripts/update_lib/deps.py:1222–1236  ·  view source on GitHub ↗

Count differing lines between cpython and local Lib for a module.

(name: str, cpython_prefix: str, lib_prefix: str)

Source from the content-addressed store, hash-verified

1220
1221
1222def get_module_diff_stat(name: str, cpython_prefix: str, lib_prefix: str) -> int:
1223 """Count differing lines between cpython and local Lib for a module."""
1224 total = 0
1225 for cpython_path in get_lib_paths(name, cpython_prefix):
1226 if not cpython_path.exists():
1227 continue
1228 try:
1229 rel_path = cpython_path.relative_to(cpython_prefix)
1230 local_path = pathlib.Path(lib_prefix) / rel_path.relative_to("Lib")
1231 except ValueError:
1232 continue
1233 if not local_path.exists():
1234 continue
1235 total += _count_path_diff(cpython_path, local_path)
1236 return total
1237
1238
1239def get_test_last_updated(

Callers 1

format_all_todoFunction · 0.90

Calls 4

get_lib_pathsFunction · 0.85
_count_path_diffFunction · 0.85
existsMethod · 0.45
relative_toMethod · 0.45

Tested by

no test coverage detected