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.
- django_compose-0.1.0.dev1/.gitignore +12 -0
- django_compose-0.1.0.dev1/AGENTS.md +27 -0
- django_compose-0.1.0.dev1/CHANGELOG.md +37 -0
- django_compose-0.1.0.dev1/CONTRIBUTING.md +67 -0
- django_compose-0.1.0.dev1/COPYING +674 -0
- django_compose-0.1.0.dev1/LICENSE +165 -0
- django_compose-0.1.0.dev1/Makefile +25 -0
- django_compose-0.1.0.dev1/NOTICE +10 -0
- django_compose-0.1.0.dev1/PKG-INFO +101 -0
- django_compose-0.1.0.dev1/README.md +79 -0
- django_compose-0.1.0.dev1/docs/README.md +34 -0
- django_compose-0.1.0.dev1/docs/ROADMAP.md +28 -0
- django_compose-0.1.0.dev1/docs/SPEC.md +464 -0
- django_compose-0.1.0.dev1/docs/addons.md +175 -0
- django_compose-0.1.0.dev1/docs/configuration.md +369 -0
- django_compose-0.1.0.dev1/docs/dependencies.md +88 -0
- django_compose-0.1.0.dev1/docs/extensions.md +125 -0
- django_compose-0.1.0.dev1/docs/migrations.md +196 -0
- django_compose-0.1.0.dev1/docs/models.md +187 -0
- django_compose-0.1.0.dev1/docs/packaging.md +142 -0
- django_compose-0.1.0.dev1/docs/proposals/README.md +14 -0
- django_compose-0.1.0.dev1/docs/quickstart.md +180 -0
- django_compose-0.1.0.dev1/examples/shop/.gitignore +2 -0
- django_compose-0.1.0.dev1/examples/shop/README.md +35 -0
- django_compose-0.1.0.dev1/examples/shop/catalog/__init__.py +0 -0
- django_compose-0.1.0.dev1/examples/shop/catalog/apps.py +24 -0
- django_compose-0.1.0.dev1/examples/shop/catalog/autoconfig.py +6 -0
- django_compose-0.1.0.dev1/examples/shop/catalog/integrations.py +28 -0
- django_compose-0.1.0.dev1/examples/shop/catalog/management/__init__.py +0 -0
- django_compose-0.1.0.dev1/examples/shop/catalog/management/commands/__init__.py +0 -0
- django_compose-0.1.0.dev1/examples/shop/catalog/management/commands/verify_context.py +21 -0
- django_compose-0.1.0.dev1/examples/shop/catalog/models.py +16 -0
- django_compose-0.1.0.dev1/examples/shop/catalog/pyproject.toml +15 -0
- django_compose-0.1.0.dev1/examples/shop/catalog/schema.py +6 -0
- django_compose-0.1.0.dev1/examples/shop/catalog/transport.py +17 -0
- django_compose-0.1.0.dev1/examples/shop/catalog/urls.py +11 -0
- django_compose-0.1.0.dev1/examples/shop/contexts.py +19 -0
- django_compose-0.1.0.dev1/examples/shop/manage.py +11 -0
- django_compose-0.1.0.dev1/examples/shop/reviews/__init__.py +0 -0
- django_compose-0.1.0.dev1/examples/shop/reviews/apps.py +5 -0
- django_compose-0.1.0.dev1/examples/shop/reviews/autoconfig.py +7 -0
- django_compose-0.1.0.dev1/examples/shop/reviews/models.py +15 -0
- django_compose-0.1.0.dev1/examples/shop/reviews/pyproject.toml +15 -0
- django_compose-0.1.0.dev1/examples/shop/settings.py +25 -0
- django_compose-0.1.0.dev1/examples/shop/urls.py +3 -0
- django_compose-0.1.0.dev1/examples/shop/verify.py +65 -0
- django_compose-0.1.0.dev1/pyproject.toml +57 -0
- django_compose-0.1.0.dev1/scripts/check_distribution.py +377 -0
- django_compose-0.1.0.dev1/src/django_compose/__init__.py +0 -0
- django_compose-0.1.0.dev1/src/django_compose/__main__.py +5 -0
- django_compose-0.1.0.dev1/src/django_compose/addons.py +205 -0
- django_compose-0.1.0.dev1/src/django_compose/apps.py +103 -0
- django_compose-0.1.0.dev1/src/django_compose/artifacts.py +224 -0
- django_compose-0.1.0.dev1/src/django_compose/asgi.py +110 -0
- django_compose-0.1.0.dev1/src/django_compose/autoreload.py +110 -0
- django_compose-0.1.0.dev1/src/django_compose/build.py +282 -0
- django_compose-0.1.0.dev1/src/django_compose/checks.py +11 -0
- django_compose-0.1.0.dev1/src/django_compose/cli.py +12 -0
- django_compose-0.1.0.dev1/src/django_compose/conf.py +322 -0
- django_compose-0.1.0.dev1/src/django_compose/declarations.py +168 -0
- django_compose-0.1.0.dev1/src/django_compose/history.py +36 -0
- django_compose-0.1.0.dev1/src/django_compose/management/__init__.py +221 -0
- django_compose-0.1.0.dev1/src/django_compose/management/commands/__init__.py +1 -0
- django_compose-0.1.0.dev1/src/django_compose/management/commands/check_migrations.py +57 -0
- django_compose-0.1.0.dev1/src/django_compose/management/commands/compose.py +42 -0
- django_compose-0.1.0.dev1/src/django_compose/management/commands/makemigrations.py +136 -0
- django_compose-0.1.0.dev1/src/django_compose/management/commands/migrate.py +18 -0
- django_compose-0.1.0.dev1/src/django_compose/management/commands/reset_migration_history.py +34 -0
- django_compose-0.1.0.dev1/src/django_compose/management/commands/retire_history.py +24 -0
- django_compose-0.1.0.dev1/src/django_compose/migration_imports.py +474 -0
- django_compose-0.1.0.dev1/src/django_compose/migrations.py +843 -0
- django_compose-0.1.0.dev1/src/django_compose/model_composition.py +292 -0
- django_compose-0.1.0.dev1/src/django_compose/models.py +65 -0
- django_compose-0.1.0.dev1/src/django_compose/py.typed +0 -0
- django_compose-0.1.0.dev1/src/django_compose/rendering.py +92 -0
- django_compose-0.1.0.dev1/src/django_compose/serving.py +405 -0
- django_compose-0.1.0.dev1/src/django_compose/snapshot.py +419 -0
- django_compose-0.1.0.dev1/src/django_compose/sources.py +147 -0
- django_compose-0.1.0.dev1/src/django_compose/typing.py +633 -0
- django_compose-0.1.0.dev1/src/django_compose/urls.py +58 -0
- django_compose-0.1.0.dev1/tests/core_fixtures/__init__.py +71 -0
- django_compose-0.1.0.dev1/tests/test_addons.py +538 -0
- django_compose-0.1.0.dev1/tests/test_artifacts.py +169 -0
- django_compose-0.1.0.dev1/tests/test_asgi.py +201 -0
- django_compose-0.1.0.dev1/tests/test_autoreload.py +115 -0
- django_compose-0.1.0.dev1/tests/test_bootstrap.py +475 -0
- django_compose-0.1.0.dev1/tests/test_boundaries.py +111 -0
- django_compose-0.1.0.dev1/tests/test_command_context.py +179 -0
- django_compose-0.1.0.dev1/tests/test_conf.py +754 -0
- django_compose-0.1.0.dev1/tests/test_history.py +382 -0
- django_compose-0.1.0.dev1/tests/test_initial_history.py +171 -0
- django_compose-0.1.0.dev1/tests/test_integrations.py +331 -0
- django_compose-0.1.0.dev1/tests/test_launcher.py +368 -0
- django_compose-0.1.0.dev1/tests/test_migration_imports.py +422 -0
- django_compose-0.1.0.dev1/tests/test_migration_scaffold.py +148 -0
- django_compose-0.1.0.dev1/tests/test_migrations.py +706 -0
- django_compose-0.1.0.dev1/tests/test_migrations_guards.py +472 -0
- django_compose-0.1.0.dev1/tests/test_models.py +708 -0
- django_compose-0.1.0.dev1/tests/test_snapshot.py +563 -0
- django_compose-0.1.0.dev1/tests/test_sources.py +108 -0
- django_compose-0.1.0.dev1/tests/test_startup.py +299 -0
- django_compose-0.1.0.dev1/tests/test_typing.py +491 -0
- django_compose-0.1.0.dev1/tests/test_urls.py +59 -0
- django_compose-0.1.0.dev1/tests/typing_fixtures/__init__.py +351 -0
- django_compose-0.1.0.dev1/uv.lock +964 -0
|
@@ -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.
|