Load configuration from text, over-writing options already set in this object. May raise OptionsError if the config file is invalid.
(opts: OptManager, text: str, cwd: Path | str | None = None)
| 546 | |
| 547 | |
| 548 | def load(opts: OptManager, text: str, cwd: Path | str | None = None) -> None: |
| 549 | """ |
| 550 | Load configuration from text, over-writing options already set in |
| 551 | this object. May raise OptionsError if the config file is invalid. |
| 552 | """ |
| 553 | data = parse(text) |
| 554 | |
| 555 | scripts = data.get("scripts") |
| 556 | if scripts is not None and cwd is not None: |
| 557 | data["scripts"] = [ |
| 558 | str(relative_path(Path(path), relative_to=Path(cwd))) for path in scripts |
| 559 | ] |
| 560 | |
| 561 | opts.update_defer(**data) |
| 562 | |
| 563 | |
| 564 | def load_paths(opts: OptManager, *paths: Path | str) -> None: |
no test coverage detected
searching dependent graphs…