(prefix, name, config, quiet)
| 309 | |
| 310 | |
| 311 | def 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 | |
| 341 | def write_library_config(prefix, name, config, quiet): |
no test coverage detected
searching dependent graphs…