Get the last git commit date for a module's Lib files.
(
name: str, cpython_prefix: str, lib_prefix: str
)
| 1200 | |
| 1201 | |
| 1202 | def get_module_last_updated( |
| 1203 | name: str, cpython_prefix: str, lib_prefix: str |
| 1204 | ) -> str | None: |
| 1205 | """Get the last git commit date for a module's Lib files.""" |
| 1206 | local_paths = [] |
| 1207 | for cpython_path in get_lib_paths(name, cpython_prefix): |
| 1208 | if not cpython_path.exists(): |
| 1209 | continue |
| 1210 | try: |
| 1211 | rel_path = cpython_path.relative_to(cpython_prefix) |
| 1212 | local_path = pathlib.Path(lib_prefix) / rel_path.relative_to("Lib") |
| 1213 | if local_path.exists(): |
| 1214 | local_paths.append(str(local_path)) |
| 1215 | except ValueError: |
| 1216 | continue |
| 1217 | if not local_paths: |
| 1218 | return None |
| 1219 | return _lookup_last_updated(local_paths, lib_prefix) |
| 1220 | |
| 1221 | |
| 1222 | def get_module_diff_stat(name: str, cpython_prefix: str, lib_prefix: str) -> int: |
no test coverage detected