Recursive attr.evolve() method, where any attr-based attributes will be evolved too.
(inst, **changes)
| 33 | |
| 34 | |
| 35 | def evolve_recursive(inst, **changes): |
| 36 | """Recursive attr.evolve() method, where any attr-based attributes |
| 37 | will be evolved too. |
| 38 | """ |
| 39 | for key, value in changes.items(): |
| 40 | v = getattr(inst, key) |
| 41 | if has(type(v)) and isinstance(value, dict): |
| 42 | value = evolve_recursive(v, **value) |
| 43 | changes[key] = value |
| 44 | return evolve(inst, **changes) |
| 45 | |
| 46 | |
| 47 | def test_dvc(tmp_dir, scm, dvc: "Repo"): |
no test coverage detected