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

Function _lookup_last_updated

scripts/update_lib/deps.py:1182–1199  ·  view source on GitHub ↗

Look up the most recent date among paths from the bulk cache.

(paths: list[str], lib_prefix: str)

Source from the content-addressed store, hash-verified

1180
1181
1182def _lookup_last_updated(paths: list[str], lib_prefix: str) -> str | None:
1183 """Look up the most recent date among paths from the bulk cache."""
1184 cache = _bulk_last_updated()
1185 prefix = _lib_prefix_stripped(lib_prefix)
1186 latest = None
1187 for p in paths:
1188 p_norm = pathlib.Path(p).as_posix()
1189 # Strip lib_prefix to get Lib-relative key
1190 # e.g. "Lib/test/test_os.py" -> "test/test_os.py"
1191 # "../Lib/re" -> "re"
1192 if p_norm.startswith(prefix):
1193 key = p_norm[len(prefix) :]
1194 else:
1195 key = p_norm
1196 date = cache.get(key)
1197 if date and (latest is None or date > latest):
1198 latest = date
1199 return latest
1200
1201
1202def get_module_last_updated(

Callers 2

get_module_last_updatedFunction · 0.85
get_test_last_updatedFunction · 0.85

Calls 6

_bulk_last_updatedFunction · 0.85
_lib_prefix_strippedFunction · 0.85
lenFunction · 0.85
as_posixMethod · 0.80
startswithMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected