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

Function get_module_last_updated

scripts/update_lib/deps.py:1202–1219  ·  view source on GitHub ↗

Get the last git commit date for a module's Lib files.

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

Source from the content-addressed store, hash-verified

1200
1201
1202def 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
1222def get_module_diff_stat(name: str, cpython_prefix: str, lib_prefix: str) -> int:

Callers 1

format_all_todoFunction · 0.90

Calls 6

get_lib_pathsFunction · 0.85
strFunction · 0.85
_lookup_last_updatedFunction · 0.85
existsMethod · 0.45
relative_toMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected