(apps_config: dict[str, dict[str, Any]])
| 165 | |
| 166 | |
| 167 | def normalize_apps_config(apps_config: dict[str, dict[str, Any]]) -> dict[str, dict[str, Any]]: |
| 168 | normalized: dict[str, dict[str, Any]] = {} |
| 169 | for label, config in apps_config.items(): |
| 170 | updated = dict(config) |
| 171 | if "migrations" not in updated: |
| 172 | inferred = infer_migrations_module(updated.get("models")) |
| 173 | if inferred: |
| 174 | try: |
| 175 | if importlib.util.find_spec(inferred) is not None: |
| 176 | updated["migrations"] = inferred |
| 177 | except (ModuleNotFoundError, AttributeError, ValueError): |
| 178 | # Module doesn't exist or isn't a package - skip migrations inference |
| 179 | pass |
| 180 | normalized[label] = updated |
| 181 | return normalized |
nothing calls this directly
no test coverage detected
searching dependent graphs…