MCPcopy
hub / github.com/django/django / main

Function main

scripts/check_migrations.py:5–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3
4
5def main():
6 repo_root = Path(__file__).resolve().parent.parent
7 sys.path[:0] = [str(repo_root / "tests"), str(repo_root)]
8
9 from runtests import ALWAYS_INSTALLED_APPS, get_apps_to_install, get_test_modules
10
11 import django
12 from django.apps import apps
13 from django.core.management import call_command
14
15 django.setup()
16
17 test_modules = list(get_test_modules(gis_enabled=False))
18 installed_apps = list(ALWAYS_INSTALLED_APPS)
19 for app in get_apps_to_install(test_modules):
20 # Check against the list to prevent duplicate errors.
21 if app not in installed_apps:
22 installed_apps.append(app)
23 apps.set_installed_apps(installed_apps)
24
25 # Note: We don't use check=True here because --check calls sys.exit(1)
26 # instead of raising CommandError when migrations are missing.
27 call_command("makemigrations", "--check", verbosity=3)
28
29
30if __name__ == "__main__":

Callers 2

lint.pyFile · 0.50

Calls 7

get_test_modulesFunction · 0.90
get_apps_to_installFunction · 0.90
call_commandFunction · 0.90
set_installed_appsMethod · 0.80
resolveMethod · 0.45
setupMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…