django-compose 0.1.0.dev1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. django_compose-0.1.0.dev1/.gitignore +12 -0
  2. django_compose-0.1.0.dev1/AGENTS.md +27 -0
  3. django_compose-0.1.0.dev1/CHANGELOG.md +37 -0
  4. django_compose-0.1.0.dev1/CONTRIBUTING.md +67 -0
  5. django_compose-0.1.0.dev1/COPYING +674 -0
  6. django_compose-0.1.0.dev1/LICENSE +165 -0
  7. django_compose-0.1.0.dev1/Makefile +25 -0
  8. django_compose-0.1.0.dev1/NOTICE +10 -0
  9. django_compose-0.1.0.dev1/PKG-INFO +101 -0
  10. django_compose-0.1.0.dev1/README.md +79 -0
  11. django_compose-0.1.0.dev1/docs/README.md +34 -0
  12. django_compose-0.1.0.dev1/docs/ROADMAP.md +28 -0
  13. django_compose-0.1.0.dev1/docs/SPEC.md +464 -0
  14. django_compose-0.1.0.dev1/docs/addons.md +175 -0
  15. django_compose-0.1.0.dev1/docs/configuration.md +369 -0
  16. django_compose-0.1.0.dev1/docs/dependencies.md +88 -0
  17. django_compose-0.1.0.dev1/docs/extensions.md +125 -0
  18. django_compose-0.1.0.dev1/docs/migrations.md +196 -0
  19. django_compose-0.1.0.dev1/docs/models.md +187 -0
  20. django_compose-0.1.0.dev1/docs/packaging.md +142 -0
  21. django_compose-0.1.0.dev1/docs/proposals/README.md +14 -0
  22. django_compose-0.1.0.dev1/docs/quickstart.md +180 -0
  23. django_compose-0.1.0.dev1/examples/shop/.gitignore +2 -0
  24. django_compose-0.1.0.dev1/examples/shop/README.md +35 -0
  25. django_compose-0.1.0.dev1/examples/shop/catalog/__init__.py +0 -0
  26. django_compose-0.1.0.dev1/examples/shop/catalog/apps.py +24 -0
  27. django_compose-0.1.0.dev1/examples/shop/catalog/autoconfig.py +6 -0
  28. django_compose-0.1.0.dev1/examples/shop/catalog/integrations.py +28 -0
  29. django_compose-0.1.0.dev1/examples/shop/catalog/management/__init__.py +0 -0
  30. django_compose-0.1.0.dev1/examples/shop/catalog/management/commands/__init__.py +0 -0
  31. django_compose-0.1.0.dev1/examples/shop/catalog/management/commands/verify_context.py +21 -0
  32. django_compose-0.1.0.dev1/examples/shop/catalog/models.py +16 -0
  33. django_compose-0.1.0.dev1/examples/shop/catalog/pyproject.toml +15 -0
  34. django_compose-0.1.0.dev1/examples/shop/catalog/schema.py +6 -0
  35. django_compose-0.1.0.dev1/examples/shop/catalog/transport.py +17 -0
  36. django_compose-0.1.0.dev1/examples/shop/catalog/urls.py +11 -0
  37. django_compose-0.1.0.dev1/examples/shop/contexts.py +19 -0
  38. django_compose-0.1.0.dev1/examples/shop/manage.py +11 -0
  39. django_compose-0.1.0.dev1/examples/shop/reviews/__init__.py +0 -0
  40. django_compose-0.1.0.dev1/examples/shop/reviews/apps.py +5 -0
  41. django_compose-0.1.0.dev1/examples/shop/reviews/autoconfig.py +7 -0
  42. django_compose-0.1.0.dev1/examples/shop/reviews/models.py +15 -0
  43. django_compose-0.1.0.dev1/examples/shop/reviews/pyproject.toml +15 -0
  44. django_compose-0.1.0.dev1/examples/shop/settings.py +25 -0
  45. django_compose-0.1.0.dev1/examples/shop/urls.py +3 -0
  46. django_compose-0.1.0.dev1/examples/shop/verify.py +65 -0
  47. django_compose-0.1.0.dev1/pyproject.toml +57 -0
  48. django_compose-0.1.0.dev1/scripts/check_distribution.py +377 -0
  49. django_compose-0.1.0.dev1/src/django_compose/__init__.py +0 -0
  50. django_compose-0.1.0.dev1/src/django_compose/__main__.py +5 -0
  51. django_compose-0.1.0.dev1/src/django_compose/addons.py +205 -0
  52. django_compose-0.1.0.dev1/src/django_compose/apps.py +103 -0
  53. django_compose-0.1.0.dev1/src/django_compose/artifacts.py +224 -0
  54. django_compose-0.1.0.dev1/src/django_compose/asgi.py +110 -0
  55. django_compose-0.1.0.dev1/src/django_compose/autoreload.py +110 -0
  56. django_compose-0.1.0.dev1/src/django_compose/build.py +282 -0
  57. django_compose-0.1.0.dev1/src/django_compose/checks.py +11 -0
  58. django_compose-0.1.0.dev1/src/django_compose/cli.py +12 -0
  59. django_compose-0.1.0.dev1/src/django_compose/conf.py +322 -0
  60. django_compose-0.1.0.dev1/src/django_compose/declarations.py +168 -0
  61. django_compose-0.1.0.dev1/src/django_compose/history.py +36 -0
  62. django_compose-0.1.0.dev1/src/django_compose/management/__init__.py +221 -0
  63. django_compose-0.1.0.dev1/src/django_compose/management/commands/__init__.py +1 -0
  64. django_compose-0.1.0.dev1/src/django_compose/management/commands/check_migrations.py +57 -0
  65. django_compose-0.1.0.dev1/src/django_compose/management/commands/compose.py +42 -0
  66. django_compose-0.1.0.dev1/src/django_compose/management/commands/makemigrations.py +136 -0
  67. django_compose-0.1.0.dev1/src/django_compose/management/commands/migrate.py +18 -0
  68. django_compose-0.1.0.dev1/src/django_compose/management/commands/reset_migration_history.py +34 -0
  69. django_compose-0.1.0.dev1/src/django_compose/management/commands/retire_history.py +24 -0
  70. django_compose-0.1.0.dev1/src/django_compose/migration_imports.py +474 -0
  71. django_compose-0.1.0.dev1/src/django_compose/migrations.py +843 -0
  72. django_compose-0.1.0.dev1/src/django_compose/model_composition.py +292 -0
  73. django_compose-0.1.0.dev1/src/django_compose/models.py +65 -0
  74. django_compose-0.1.0.dev1/src/django_compose/py.typed +0 -0
  75. django_compose-0.1.0.dev1/src/django_compose/rendering.py +92 -0
  76. django_compose-0.1.0.dev1/src/django_compose/serving.py +405 -0
  77. django_compose-0.1.0.dev1/src/django_compose/snapshot.py +419 -0
  78. django_compose-0.1.0.dev1/src/django_compose/sources.py +147 -0
  79. django_compose-0.1.0.dev1/src/django_compose/typing.py +633 -0
  80. django_compose-0.1.0.dev1/src/django_compose/urls.py +58 -0
  81. django_compose-0.1.0.dev1/tests/core_fixtures/__init__.py +71 -0
  82. django_compose-0.1.0.dev1/tests/test_addons.py +538 -0
  83. django_compose-0.1.0.dev1/tests/test_artifacts.py +169 -0
  84. django_compose-0.1.0.dev1/tests/test_asgi.py +201 -0
  85. django_compose-0.1.0.dev1/tests/test_autoreload.py +115 -0
  86. django_compose-0.1.0.dev1/tests/test_bootstrap.py +475 -0
  87. django_compose-0.1.0.dev1/tests/test_boundaries.py +111 -0
  88. django_compose-0.1.0.dev1/tests/test_command_context.py +179 -0
  89. django_compose-0.1.0.dev1/tests/test_conf.py +754 -0
  90. django_compose-0.1.0.dev1/tests/test_history.py +382 -0
  91. django_compose-0.1.0.dev1/tests/test_initial_history.py +171 -0
  92. django_compose-0.1.0.dev1/tests/test_integrations.py +331 -0
  93. django_compose-0.1.0.dev1/tests/test_launcher.py +368 -0
  94. django_compose-0.1.0.dev1/tests/test_migration_imports.py +422 -0
  95. django_compose-0.1.0.dev1/tests/test_migration_scaffold.py +148 -0
  96. django_compose-0.1.0.dev1/tests/test_migrations.py +706 -0
  97. django_compose-0.1.0.dev1/tests/test_migrations_guards.py +472 -0
  98. django_compose-0.1.0.dev1/tests/test_models.py +708 -0
  99. django_compose-0.1.0.dev1/tests/test_snapshot.py +563 -0
  100. django_compose-0.1.0.dev1/tests/test_sources.py +108 -0
  101. django_compose-0.1.0.dev1/tests/test_startup.py +299 -0
  102. django_compose-0.1.0.dev1/tests/test_typing.py +491 -0
  103. django_compose-0.1.0.dev1/tests/test_urls.py +59 -0
  104. django_compose-0.1.0.dev1/tests/typing_fixtures/__init__.py +351 -0
  105. django_compose-0.1.0.dev1/uv.lock +964 -0
@@ -0,0 +1,12 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.py[cod]
4
+ .pytest_cache/
5
+ .mypy_cache/
6
+ .ruff_cache/
7
+ .coverage
8
+ htmlcov/
9
+ dist/
10
+ build/
11
+ *.egg-info/
12
+ test-results/
@@ -0,0 +1,27 @@
1
+ # django-compose
2
+
3
+ This is an independent Django composition library. Consumers depend on this
4
+ package; this package never imports a consumer framework, host, or product.
5
+ `docs/SPEC.md` owns the contract. Read it before changing a public seam.
6
+
7
+ Find the owner first. Django owns application identity and population, model
8
+ construction, fields, managers, migration state, execution, routing, and history.
9
+ This package owns only the missing composition, deterministic emission, and
10
+ reusable migration binding seams. Do not add parallel registries or parsers.
11
+
12
+ Keep entrypoints thin, names consistent, and policy on the owning object.
13
+ Preserve native extension points and fail explicitly on competing declarations.
14
+ Delete obsolete paths rather than leave competing implementations. Changes must
15
+ agree with their docs and tests. Do not copy implementation files from another
16
+ repository; reconstruct behavior through the public native owners.
17
+
18
+ Use jj for version-control writes. Do not rewrite published history. Each agent
19
+ owns a separate workspace and a disjoint file set; never revert another lane.
20
+ Read files before and after editing. Keep scratch and evidence outside source.
21
+ Run `make check` and `make dist-check` before delivery. Report checks not run.
22
+ Never run or modify a consumer's live stack to validate this independent library.
23
+
24
+ Public docs contain durable contracts and contributor guidance. Private plans,
25
+ lane reports, and review receipts belong in the adjacent work-state workspace.
26
+ Publication requires explicit authorization; building and local commits do not
27
+ publish the package.
@@ -0,0 +1,37 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0.dev1
4
+
5
+ - Report the composition lock path and wait duration when another reader or
6
+ writer blocks a build, without assuming that a development server holds it.
7
+ - Publish checked wheel and source archives through the GitHub release workflow.
8
+ - Keep the `typing` extra installable from PyPI with the published
9
+ `angee-django-stubs`, `angee-django-stubs-ext`, and `angee-mypy` forks.
10
+ - Give `settings.COMPOSE_SNAPSHOT` and `settings.COMPOSE_CLOSURE` their exact
11
+ native types while preserving Django's ordinary settings diagnostics.
12
+ - Expose `apply_app_settings(namespace, closure)` for applying selected apps'
13
+ settings contributions to a project with ordinary authored concrete models.
14
+
15
+ ## 0.1.0.dev0 — unreleased
16
+
17
+ - Compose reusable Django source apps and extension classes into ordinary
18
+ concrete models with `concrete`, `extends`, `inherits` and `demands` declarations.
19
+ - Configure project settings through `configure(globals())`, with native
20
+ app dependencies, django-yamlconf contributions and immutable inputs.
21
+ - Verify generated output under a shared startup lock through native ready
22
+ callbacks, and reject stale or altered output before model population.
23
+ - Optionally select installed apps through entry-point and dependency metadata.
24
+ - Keep native migration history when an app is disabled; bind reusable authored
25
+ transitions and guard automatic destructive changes across routed databases.
26
+ - Audit retained migration imports and installed providers before a proposed
27
+ distribution removal, with explicit unsupported/unresolved results.
28
+ - Offer advanced composed-model typing through pinned django-stubs/mypy forks;
29
+ base dependencies are Django, packaging and django-yamlconf.
30
+ - Include a plain Django example, user guides and fresh installed-wheel checks.
31
+ - Render declared artifacts in models and ready phases, then finalize publication;
32
+ expose verified artifact paths and receipt leases to startup and serving readers.
33
+ - Compose native URL declarations, ASGI mounts/protocols and ordered lifespans.
34
+ - Recompose before native development-server children start, report inputs before
35
+ reads and recover after failed composition and file creation/deletion.
36
+ - Inspect installed addon metadata without importing app modules and project
37
+ generated model typing in memory without rewriting source or stub files.
@@ -0,0 +1,67 @@
1
+ # Contributing
2
+
3
+ Use Python 3.14 and read [AGENTS.md](AGENTS.md), the
4
+ [documentation index](docs/README.md), and the [specification](docs/SPEC.md) for the
5
+ area you change. This is an independent Django library: reproduce behavior in a
6
+ plain Django project, without requiring a downstream framework or live deployment.
7
+
8
+ ## Set up and check
9
+
10
+ From the repository root, with uv installed:
11
+
12
+ ```sh
13
+ uv sync --frozen --all-extras
14
+ make check
15
+ make dist-check
16
+ ```
17
+
18
+ The full contributor environment includes the advanced typing extra and its
19
+ pinned published forks; see [dependencies](docs/dependencies.md). The user
20
+ [quick start](docs/quickstart.md) needs only base dependencies.
21
+
22
+ `make check` runs Ruff lint/format checks, mypy and pytest. For a focused test
23
+ while developing, use the same environment, for example:
24
+
25
+ ```sh
26
+ uv run --no-sync pytest -q tests/test_migrations.py
27
+ ```
28
+
29
+ `make dist-check` builds wheel and sdist, checks metadata and archive contents,
30
+ and exercises a fresh wheel installation outside the checkout. The installation
31
+ test first uses base dependencies, then installed addon wheels with settings
32
+ contributions; it covers composition, native migration history, serving, ORM behavior, stale
33
+ output refusal and retained-import reporting. CI runs the same Makefile targets.
34
+ The Checks workflow uploads archives without publishing them. The separate
35
+ [release workflow](docs/packaging.md#publish-this-library) publishes checked
36
+ archives to PyPI when explicitly dispatched or triggered by a version tag.
37
+
38
+ ## Keep behavior with its owner
39
+
40
+ Django owns app identity/population, model construction, fields, managers, ORM,
41
+ migration state and execution. Extend those native contracts instead of adding
42
+ parallel registries, parsers or lifecycle systems. django-compose owns only the
43
+ composition, deterministic output and reusable migration-binding seams.
44
+
45
+ Keep commands and other entrypoints thin. Put a missing rule on its existing
46
+ owner, migrate callers and remove superseded code and guidance. Public behavior,
47
+ types, docstrings, examples and documentation must agree. Changes to a public
48
+ invariant or extension contract use the [proposal process](docs/proposals/README.md).
49
+
50
+ Tests that configure Django use subprocesses or isolated native registries so
51
+ settings and app state do not leak between cases. Use temporary SQLite databases
52
+ for database behavior and native routers for multiple-database tests. Correct
53
+ safety failures at their owner or in the fixture.
54
+
55
+ ## Source and review
56
+
57
+ Use Jujutsu for repository writes. Parallel work uses separate workspaces and
58
+ explicit file ownership; preserve other contributors' changes. Keep disposable
59
+ runtimes, caches and reports outside tracked source. A project's native migration
60
+ history is authored source and must survive generation and cleanup.
61
+
62
+ Commit coherent changes locally. Publication requires the repository owner's
63
+ instructions. Before release, review architecture and Django behavior
64
+ independently as well as running the checks. Promote accepted contract changes
65
+ into current documentation; proposals record decisions rather than maintaining
66
+ a second API reference. Preserve license notices and attribution when changing
67
+ or distributing code.