MCPcopy Index your code
hub / github.com/python/cpython / should_build_library

Function should_build_library

Platforms/emscripten/__main__.py:311–338  ·  view source on GitHub ↗
(prefix, name, config, quiet)

Source from the content-addressed store, hash-verified

309
310
311def should_build_library(prefix, name, config, quiet):
312 cached_config = prefix / (name + ".json")
313 if not cached_config.exists():
314 if not quiet:
315 print(
316 f"No cached build of {name} version {config['version']} found, building"
317 )
318 return True
319
320 try:
321 with cached_config.open("rb") as f:
322 cached_config = json.load(f)
323 except json.JSONDecodeError:
324 if not quiet:
325 print(f"Cached data for {name} invalid, rebuilding")
326 return True
327 if config == cached_config:
328 if not quiet:
329 print(
330 f"Found cached build of {name} version {config['version']}, not rebuilding"
331 )
332 return False
333
334 if not quiet:
335 print(
336 f"Found cached build of {name} version {config['version']} but it's out of date, rebuilding"
337 )
338 return True
339
340
341def write_library_config(prefix, name, config, quiet):

Callers 2

make_emscripten_libffiFunction · 0.85
make_mpdecFunction · 0.85

Calls 3

existsMethod · 0.45
openMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…