Count differing lines between cpython and local Lib for a module.
(name: str, cpython_prefix: str, lib_prefix: str)
| 1220 | |
| 1221 | |
| 1222 | def 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 | |
| 1239 | def get_test_last_updated( |
no test coverage detected