django-due 0.1.0__py3-none-any.whl

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 (86) hide show
  1. django_due-0.1.0.dist-info/METADATA +291 -0
  2. django_due-0.1.0.dist-info/RECORD +86 -0
  3. django_due-0.1.0.dist-info/WHEEL +4 -0
  4. django_due-0.1.0.dist-info/entry_points.txt +2 -0
  5. django_due-0.1.0.dist-info/licenses/LICENSE +202 -0
  6. due/__init__.py +1 -0
  7. due/_installed.py +58 -0
  8. due/_suite_inventory.py +119 -0
  9. due/django/__init__.py +4 -0
  10. due/django/apps.py +8 -0
  11. due/django/capabilities/__init__.py +4 -0
  12. due/django/capabilities/_attempt_recovery.py +45 -0
  13. due/django/capabilities/authoring.py +1074 -0
  14. due/django/capabilities/compensation.py +153 -0
  15. due/django/capabilities/observed_operations.py +133 -0
  16. due/django/capabilities/operations.py +393 -0
  17. due/django/capabilities/projection.py +237 -0
  18. due/django/capabilities/scheduled.py +288 -0
  19. due/django/completion.py +144 -0
  20. due/django/conformance/__init__.py +21 -0
  21. due/django/conformance/_binding.py +4 -0
  22. due/django/conformance/_internal/__init__.py +1 -0
  23. due/django/conformance/_internal/immutable_inputs.py +293 -0
  24. due/django/conformance/_internal/suite.py +1477 -0
  25. due/django/conformance/background.py +550 -0
  26. due/django/conformance/background_beat.py +60 -0
  27. due/django/conformance/binding.py +4 -0
  28. due/django/conformance/bindings.py +355 -0
  29. due/django/conformance/collected_effects.py +109 -0
  30. due/django/conformance/composition.py +257 -0
  31. due/django/conformance/concurrency.py +124 -0
  32. due/django/conformance/database.py +23 -0
  33. due/django/conformance/delivery.py +150 -0
  34. due/django/conformance/discovery_admissibility.py +189 -0
  35. due/django/conformance/enrollment.py +49 -0
  36. due/django/conformance/examples.py +215 -0
  37. due/django/conformance/host.py +35 -0
  38. due/django/conformance/indexes.py +81 -0
  39. due/django/conformance/interleavings.py +114 -0
  40. due/django/conformance/observations.py +251 -0
  41. due/django/conformance/provider.py +110 -0
  42. due/django/conformance/recovery_isolation.py +309 -0
  43. due/django/conformance/registrations.py +51 -0
  44. due/django/conformance/reporting.py +145 -0
  45. due/django/conformance/scenarios.py +581 -0
  46. due/django/conformance/seams.py +425 -0
  47. due/django/conformance/suite.py +97 -0
  48. due/django/conformance/suite_collection.py +238 -0
  49. due/django/conformance/worker_connection.py +16 -0
  50. due/django/declarations/__init__.py +4 -0
  51. due/django/declarations/capture.py +70 -0
  52. due/django/declarations/dependents.py +23 -0
  53. due/django/declarations/eligibility.py +48 -0
  54. due/django/declarations/external_services.py +56 -0
  55. due/django/declarations/mirrors.py +80 -0
  56. due/django/evidence/__init__.py +4 -0
  57. due/django/evidence/attempts.py +280 -0
  58. due/django/evidence/effect_evidence.py +101 -0
  59. due/django/integration.py +72 -0
  60. due/django/management/__init__.py +0 -0
  61. due/django/management/commands/__init__.py +0 -0
  62. due/django/management/commands/due_check.py +47 -0
  63. due/django/management/commands/due_status.py +96 -0
  64. due/django/migrations/0001_initial.py +102 -0
  65. due/django/migrations/__init__.py +1 -0
  66. due/django/models.py +329 -0
  67. due/django/public.py +113 -0
  68. due/django/runtime/__init__.py +4 -0
  69. due/django/runtime/_delivery.py +163 -0
  70. due/django/runtime/coordination.py +1133 -0
  71. due/django/runtime/counters.py +22 -0
  72. due/django/runtime/diagnostics.py +67 -0
  73. due/django/runtime/limits.py +7 -0
  74. due/django/runtime/metrics.py +297 -0
  75. due/django/runtime/names.py +13 -0
  76. due/django/runtime/recovery_pass.py +546 -0
  77. due/django/runtime/registry.py +204 -0
  78. due/django/runtime/tasks.py +59 -0
  79. due/django/runtime/transport.py +56 -0
  80. due/django/testing.py +136 -0
  81. due/errors.py +77 -0
  82. due/observability.py +17 -0
  83. due/observations.py +20 -0
  84. due/py.typed +0 -0
  85. due/pytest_plugin.py +69 -0
  86. due/retry_delays.py +33 -0
@@ -0,0 +1,291 @@
1
+ Metadata-Version: 2.5
2
+ Name: django-due
3
+ Version: 0.1.0
4
+ Summary: Durable obligations for Django and PostgreSQL
5
+ Project-URL: Homepage, https://github.com/gigaverse-app/due
6
+ Project-URL: Repository, https://github.com/gigaverse-app/due
7
+ Project-URL: Issues, https://github.com/gigaverse-app/due/issues
8
+ Author: Gigaverse
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3.14
14
+ Classifier: Topic :: System :: Distributed Computing
15
+ Classifier: Typing :: Typed
16
+ Requires-Python: >=3.14
17
+ Requires-Dist: asgiref>=3.9
18
+ Requires-Dist: celery<6,>=5.6
19
+ Requires-Dist: django<7,>=6.0.8
20
+ Requires-Dist: prometheus-client>=0.22
21
+ Requires-Dist: psycopg[binary]<4,>=3.2
22
+ Requires-Dist: pydantic<3,>=2.12
23
+ Requires-Dist: sentry-sdk<3,>=2
24
+ Provides-Extra: beat
25
+ Requires-Dist: django-celery-beat>=2.8; extra == 'beat'
26
+ Provides-Extra: redis
27
+ Requires-Dist: celery[redis]<6,>=5.6; extra == 'redis'
28
+ Provides-Extra: testing
29
+ Requires-Dist: pytest-obligation[celery,debt,django,exploration]<1,>=0.11.0; extra == 'testing'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # Due
33
+
34
+ **An attempt can end. The obligation remains.**
35
+
36
+ [![CI](https://github.com/gigaverse-app/due/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/gigaverse-app/due/actions/workflows/ci.yml)
37
+ [![Python 3.14](https://img.shields.io/badge/python-3.14-blue)](pyproject.toml)
38
+ [![Django 6](https://img.shields.io/badge/Django-6-092E20?logo=django)](docs/integration.md)
39
+ [![Typed](https://img.shields.io/badge/typing-py.typed-blue)](src/due/py.typed)
40
+ [![Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
41
+
42
+ The PyPI distribution name is **`django-due`** (`pip install django-due`).
43
+ Python imports remain **`due`**. See [releasing](RELEASING.md) for the manual release process.
44
+
45
+ ## The database committed. The worker never heard.
46
+
47
+ You save a document and queue its publication. The broker is unavailable. Or the
48
+ worker writes the file and dies before recording success. Or a slow worker
49
+ returns after a newer revision has already finished.
50
+
51
+ **Due keeps track of what your Django application still owes.** It records the
52
+ obligation in PostgreSQL alongside the product change, uses Celery to attempt it,
53
+ and recovers work after lost messages and dead workers. Captured ownership tokens
54
+ and revisions prevent an old worker from settling a newer obligation.
55
+
56
+ ```mermaid
57
+ flowchart LR
58
+ A[Application transaction] --> B[(PostgreSQL: product + obligation)]
59
+ A -. after commit .-> C[Celery worker]
60
+ B --> D[Periodic recovery]
61
+ D --> C
62
+ C --> E[External effect]
63
+ E --> F[Fenced local settlement]
64
+ F --> B
65
+ ```
66
+
67
+ The message gets work started sooner. The database remembers what remains owed.
68
+
69
+ [When Due is the right tool: strengths, tradeoffs, and alternatives →](docs/why-due.md)
70
+
71
+ ## What happens when things go wrong?
72
+
73
+ | Failure | Due's response |
74
+ | --- | --- |
75
+ | Commit succeeds; queue publication is lost | Recovery finds the work and reserves another delivery. |
76
+ | The broker delivers the same message twice | Only the captured owner can execute and settle it. |
77
+ | A worker dies or returns after its lease expires | Recovery handles the expiry; stale settlement is rejected. |
78
+ | Desired inputs change during execution | Revisions fence old settlement; the current target stays owed. |
79
+ | A non-repeatable request times out | Its outcome stays **UNKNOWN** until correlated evidence resolves it. |
80
+ | One recovery row always raises | Other identities progress; the failure is reported and held with backoff. |
81
+ | Retries are exhausted | Work remains visibly stopped for an explicit application decision. |
82
+
83
+ A local lease cannot cancel an external request. **Due does not promise
84
+ exactly-once external execution.** Your application defines replay safety,
85
+ provider idempotency, evidence, and success. [Guarantees and limits →](docs/architecture.md)
86
+
87
+ ```text
88
+ commit product + obligation --> notify worker --> execute --> fenced settlement
89
+ | X lost
90
+ +------ recurring recovery --------> execute --> fenced settlement
91
+ ```
92
+
93
+ [Follow a real obligation through message loss and process death →](docs/recovery-walkthrough.md)
94
+
95
+ ## More than a task queue
96
+
97
+ Use Due when a business obligation must survive the attempt that tried to
98
+ fulfill it. Celery remains the transport; your application retains its own
99
+ models, transactions and product logic.
100
+
101
+ | What your application owes | Start with |
102
+ | --- | --- |
103
+ | A safely repeatable effect | `ReplaySafeEffect` |
104
+ | An external view of changing desired state | `Projection` |
105
+ | An action at a movable or cancellable deadline | `ScheduledAction` |
106
+ | A non-repeatable operation, such as a provider request with an uncertain outcome | `DurableExternalOperation` |
107
+ | Periodic observation of an uncertain operation | `ObservedExternalOperation` |
108
+ | Cleanup owed even if the original worker dies | `IndependentCompensation` |
109
+ | Fenced completion on a row with an existing lifecycle | [Completion leases](docs/completion-leases.md) |
110
+
111
+ The same work-table runtime also supports dependent wakes, discovery from
112
+ persisted facts, execution gates, continuations, status mirrors and captured
113
+ inputs. [Capability guide and executable examples →](docs/capabilities.md)
114
+
115
+ **Alpha, Django-backed.** Extracted from Gigaverse's work-table primitive; the API
116
+ may change before 1.0. Only work-table composition is public. Native-table
117
+ composition is excluded. [Extraction scope →](docs/extraction.md) · [Cutover audit and regression controls →](docs/cutover-audit.md)
118
+
119
+ ## Coming from another library?
120
+
121
+ Start with [your library's migration guide](docs/migrations.md). Each guide
122
+ covers the benefits of adopting Due, a concrete migration, behavior to preserve,
123
+ cutover and rollback, and whether a compatibility layer would help. Guides cover
124
+ Procrastinate, DBOS, RQ, Django Tasks, Celery and the other Python libraries in
125
+ [the background-work ecosystem overview](docs/alternatives.md).
126
+
127
+ ## Install
128
+
129
+ Requires Python 3.14, PostgreSQL and a Django 6 application. Celery needs a broker
130
+ and a running worker plus a recurring recovery scheduler (normally Celery Beat).
131
+ The integration suite uses PostgreSQL 17 and Redis 7.
132
+
133
+ Until a PyPI release is published, install from GitHub:
134
+
135
+ ```bash
136
+ uv add 'due[redis] @ git+https://github.com/gigaverse-app/due.git'
137
+ ```
138
+
139
+ Add `"due.django"` to `INSTALLED_APPS`, then run your application's migrations.
140
+ Your own work models subclass `UniverseDurableWork`, declare captured inputs,
141
+ and include `durable_work_schema(...)` in their indexes and constraints.
142
+ `universe` is an unrestricted tenant key retained for extraction compatibility;
143
+ use an empty string for a single-tenant application.
144
+
145
+ A capability puts external I/O and local settlement in different methods:
146
+
147
+ ```python
148
+ from due.django.public import DurableWorkPolicy, ReplaySafeEffect
149
+
150
+
151
+ class PublishDocument(ReplaySafeEffect[Document, PublicationWork, str]):
152
+ def perform_effect(self, work: PublicationWork) -> str:
153
+ return storage.put(
154
+ key=work.provider_idempotency_key(),
155
+ text=work.text,
156
+ )
157
+
158
+ def finalize_success(self, work: PublicationWork, result: str) -> None:
159
+ Document.objects.filter(pk=work.owner_id).update(published_key=result)
160
+
161
+
162
+ publication = PublishDocument.for_owner(
163
+ owner=Document,
164
+ work=PublicationWork,
165
+ policy=DurableWorkPolicy(),
166
+ )
167
+
168
+ with publication.atomic(document_id) as pending:
169
+ pending.locked_owner.text = text
170
+ pending.locked_owner.save(update_fields=["text"])
171
+ pending.request_work(PublicationWork(text=text, universe="tenant-42"))
172
+ ```
173
+
174
+ This sketch assumes your `Document`, `PublicationWork` and idempotent `storage`
175
+ implementation. The [complete runnable example](examples/documents/) includes
176
+ models, migrations, an actual filesystem effect, registration and Celery wiring.
177
+ Register every capability in **each process**; register once to generate the Beat
178
+ schedule and route both execution and recovery. See [integration](docs/integration.md).
179
+
180
+ ## Run the example
181
+
182
+ This quickstart runs the minimal [document-publication application](examples/documents/README.md).
183
+ The separate [Books application](examples/books/README.md) adapts Procrastinate’s
184
+ Django books demo into a Due workflow and documents its upstream provenance.
185
+
186
+ ```bash
187
+ git clone https://github.com/gigaverse-app/due.git
188
+ cd due
189
+ uv sync --locked
190
+ docker compose up -d
191
+ export DJANGO_SETTINGS_MODULE=examples.settings
192
+ uv run python -m django migrate
193
+ # Separate terminals, with the same settings:
194
+ uv run celery -A examples.celery_app:app worker --loglevel=INFO -Q due
195
+ uv run celery -A examples.celery_app:app beat --loglevel=INFO
196
+ ```
197
+
198
+ Create a document from another terminal:
199
+
200
+ ```bash
201
+ DJANGO_SETTINGS_MODULE=examples.settings uv run python -m django shell -c \
202
+ 'from examples.documents.models import Document; from examples.documents.effects import request_publication; document = Document.objects.create(); print(request_publication(document.pk, "Hello from Due").pk)'
203
+ ```
204
+
205
+ The worker writes an immutable revision object under `/tmp/due-documents` and
206
+ publishes its key on the document row. Configure `DUE_DATABASE_URL`,
207
+ `DUE_BROKER_URL`, `DUE_OUTPUT_DIR` and `DUE_QUEUE` as needed. Compose credentials
208
+ are for local development only; both service ports bind to localhost.
209
+
210
+ ## See recovery survive a lost message
211
+
212
+ For a browser application with two independently recoverable stages, run the
213
+ [books indexing demo](examples/books/README.md). See the
214
+ [example catalog](examples/README.md) for setup and contribution conventions.
215
+
216
+ With the local services running:
217
+
218
+ ```bash
219
+ uv run pytest tests/integration/test_celery_worker.py -v
220
+ ```
221
+
222
+ This test commits a document and its publication obligation while withholding the
223
+ initial notification. It then starts a **separate Celery prefork worker**, sends
224
+ the recovery task through **Redis**, and checks the file and product state in
225
+ **PostgreSQL**. [Read the complete failure history](tests/integration/test_celery_worker.py).
226
+
227
+ For application-bound recovery, replay, revision, admission and real process-death checks:
228
+
229
+ ```bash
230
+ uv run pytest tests/conformance -p due.django.conformance.reporting \
231
+ --due-work-summary --due-work-profile-report=profiles.json --durable-work-report=effects.json
232
+ ```
233
+
234
+ [pytest-obligation](https://github.com/gigaverse-app/pytest-obligation) generates
235
+ the applicable tests from a contract bound to Due's actual coordinator. CI
236
+ requires executed passing evidence for the claimed profiles; an empty or filtered
237
+ report fails. These proofs cover the bound example, not arbitrary application
238
+ callbacks. Enroll your own capability with `effect_contract_suite` and
239
+ `EffectExamples`: [authoring guide](docs/conformance.md),
240
+ [API and module map](docs/conformance-api.md),
241
+ [executable example](tests/conformance/document_examples.py),
242
+ [verification scope](docs/verification.md).
243
+
244
+ ## Inspect stopped work
245
+
246
+ ```bash
247
+ uv run python -m django due_status
248
+ uv run python -m django due_status publish_document --limit 10
249
+ ```
250
+
251
+ The read-only command reports exhausted, terminal-failed and unknown work,
252
+ unresolved attempts, and deferred recovery identities. It never authorizes a
253
+ replay. [Operations and monitoring →](docs/operations.md)
254
+
255
+ ## Documentation
256
+
257
+ | You want to… | Read |
258
+ | --- | --- |
259
+ | Decide whether Due fits your application | [Strengths and tradeoffs](docs/why-due.md), [alternatives](docs/alternatives.md) |
260
+ | Integrate the runtime | [Django and Celery wiring](docs/integration.md), [capabilities](docs/capabilities.md) |
261
+ | Prove your application's obligations | [Conformance walkthrough](docs/conformance.md), [executable document adopter](tests/conformance/document_examples.py) |
262
+ | Find an interface or understand scope | [Conformance API, field reference and module boundaries](docs/conformance-api.md) |
263
+ | Understand a passing result | [Verification scope](docs/verification.md), [architecture and limits](docs/architecture.md) |
264
+ | Operate and recover work | [Operations](docs/operations.md) |
265
+ | Migrate the backend harness | [Backend adoption and ownership](docs/backend-adoption.md) |
266
+
267
+ ## Contribute
268
+
269
+ ```bash
270
+ uv sync --locked
271
+ uv run pre-commit install
272
+ uv run pre-commit run --all-files
273
+ docker compose up -d --wait
274
+ uv run pytest --due-work-require-assessed --due-work-profile-report=profiles.json
275
+ uv build
276
+ ```
277
+
278
+ Pre-commit uses the Ruff and Pyrefly versions in `uv.lock`. CI also tests the
279
+ minimum Django version, checks migrations, and installs the wheel without test
280
+ dependencies. See [CONTRIBUTING.md](CONTRIBUTING.md) for the complete workflow.
281
+
282
+ [Integration](docs/integration.md) · [Architecture](docs/architecture.md) ·
283
+ [Conformance](docs/conformance.md) · [Recovery walkthrough](docs/recovery-walkthrough.md) ·
284
+ [Verification](docs/verification.md) · [Apache-2.0](LICENSE)
285
+
286
+ Conformance declarations include [checked immutable inputs](docs/conformance.md#prove-an-immutable-input-declaration), with real admission and recovery controls.
287
+
288
+ The [conformance API](docs/conformance-api.md#derive-routine-bindings-from-one-provider-seam) includes provider-seam factories and unbounded-discovery completeness; [operations](docs/operations.md#failed-infrequent-recovery) describes failed-tick evidence.
289
+
290
+
291
+ For an existing application, see [migration settings and stable wire names](docs/integration.md#migrating-an-existing-application).
@@ -0,0 +1,86 @@
1
+ due/__init__.py,sha256=LZDLvqUTLMEtic5Qv_kYBMmhX7K3we4APT1_Xnutf38,38
2
+ due/_installed.py,sha256=O8BqPlMfyP3V4O9zwYLT6249861g4VWN0uMwsZzGqjs,2329
3
+ due/_suite_inventory.py,sha256=ffOJ-6eWuLNz7OtNsT2jHKj8-No6qBt_U1QtLtFjvNU,5369
4
+ due/errors.py,sha256=pCcBOdUHsmp2TdwxTX80QIVQHl-HerEpyEnM3SHeeKc,2812
5
+ due/observability.py,sha256=aE00-VmZ0mBVmhGaBExagMha7YLwXol2kR2gHdgGdUw,444
6
+ due/observations.py,sha256=YCHXJlFEvLAomWFLdGZuiUohJVZ-eFsKuyCPXOhaBwM,679
7
+ due/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ due/pytest_plugin.py,sha256=akK4fXuYQjcAz1FpqcElJygNmPWzw38JHjYAwDHSkzI,3890
9
+ due/retry_delays.py,sha256=TeDk2fmB3U9Qc0cO8nrSjKJzPpl4BdKyQ9ZjWhF7pRU,1248
10
+ due/django/__init__.py,sha256=W1jCFo3a1iTjOP1wg1vxh8HnNRwqZY-aoO0d1Sk_8oA,160
11
+ due/django/apps.py,sha256=3f-Vd3S5NvlsehDK0TItARdvQr0HNNXyDbbSXAKMsVQ,188
12
+ due/django/completion.py,sha256=eXYAQcp-al2_DPJ6xBaFsAuOiyisTEfmDAyv0oZ136c,6963
13
+ due/django/integration.py,sha256=__LIgqp_02JkHXUneiAKRl31DFoPoh-HQueEavPNcA0,2395
14
+ due/django/models.py,sha256=sCwp_z-g5_E9OPYke0QpmhF5j09YSkSJgUBRWBjfIQU,12588
15
+ due/django/public.py,sha256=_1hQVtSWmR6WyPwiWcADP7UXwQ2J9YaexCpqd2pjMkI,2779
16
+ due/django/testing.py,sha256=rB3Cus0sNJfmelEP42kkmmp4hGbmLM2Qs557859gum8,5478
17
+ due/django/capabilities/__init__.py,sha256=kONhwfNUXnKKbBXo8GPkCa-_dzr8ka3u2jYbKWG-ZrQ,188
18
+ due/django/capabilities/_attempt_recovery.py,sha256=N9DXhb-6lkVKaTP8ooYr0S8U9Evfe3kqs-VbL2iefNo,1593
19
+ due/django/capabilities/authoring.py,sha256=wwyQgL-RtUL4wRLOLkaJHvmiAO0xvWG1FVYFrGKgN2Y,48288
20
+ due/django/capabilities/compensation.py,sha256=lhRikntTl2rrk3KfFSdvlkIHrsHyOrIVM7rwBXUtSDM,7011
21
+ due/django/capabilities/observed_operations.py,sha256=DLbJEg1TDjc5pZ3kzeVq0iF8RXrtRkvKQCmwPXP2is0,6136
22
+ due/django/capabilities/operations.py,sha256=_DepqqnvAjpQ3HU169S5tz1FAdkEYZRpY9wLbAkugfo,18353
23
+ due/django/capabilities/projection.py,sha256=_bs3FdtNBTYLKzWw-3s3Ju4nKBoMQUQKEosElKhcNcE,10177
24
+ due/django/capabilities/scheduled.py,sha256=qLlaWicw7kHvfQAs50YU2XomfxD3kQbmmw90FA0WdDY,11606
25
+ due/django/conformance/__init__.py,sha256=gDGyGsNj32ymvmJF0WZG_xEoUJWGueyCTGTeAhjqylQ,656
26
+ due/django/conformance/_binding.py,sha256=dn6_GtVTXbo03ykcICTyZ6xfVYUFuPoZCZONYlv2QlQ,226
27
+ due/django/conformance/background.py,sha256=f_sAFrLDz2hTpHkGKBR-nQg2Q4IHERcM9T9VAQljy9Q,25629
28
+ due/django/conformance/background_beat.py,sha256=6ruA2oxUmcyz2PnCQg98n7VOYHNaU0f15MGVnKlQ0CI,2280
29
+ due/django/conformance/binding.py,sha256=7R74RWRv-gf8zfphB7Gu1XwbbwXFfD4nNKdBZ7W7o1M,214
30
+ due/django/conformance/bindings.py,sha256=BO_s5yHfHZFzCZiiW_FM7cJ2ICf1eH8Ct3z34uXTNbY,15681
31
+ due/django/conformance/collected_effects.py,sha256=FZcS8yvX8WkT0iNPNBniYvrLQKNJ6HHeTxWa83sLHMQ,4420
32
+ due/django/conformance/composition.py,sha256=veU9-_LNyNgiFgj9IvADxeMF1CJFiL2wUZDU1N38YFM,11605
33
+ due/django/conformance/concurrency.py,sha256=PxB1XG0pzvqXKViv3yh9XqyhERAjKBFs9A_yawfRgG4,5521
34
+ due/django/conformance/database.py,sha256=3XyoSUGouC4Q7F9MIIPkxkFpRljOmFuqFIA0jnuf2VI,787
35
+ due/django/conformance/delivery.py,sha256=YUmCN9HaFxiIYzfRdJUdsEbrD30-8naA9TTUaNTsb3E,5955
36
+ due/django/conformance/discovery_admissibility.py,sha256=Gw18a8dnzlucGgPdp_g57a5PEBxXDrQe39KHj3b6T1U,10328
37
+ due/django/conformance/enrollment.py,sha256=f3L4ClENKqGVaasAAADEm53ASA33X6o1FMlxthHHQJ0,1900
38
+ due/django/conformance/examples.py,sha256=VonMCVy35aKhP8zO-wGakxWz7n7Njb-JPM6IcJM9j04,9671
39
+ due/django/conformance/host.py,sha256=v6eNBLohZAcPEiY8uihHUPlmsRxuGhBrr7CebJX1FTM,1446
40
+ due/django/conformance/indexes.py,sha256=Nsp1txKumbPiKNlOc7ou9msLI42dpDQK1pAdgRDY3Fo,4464
41
+ due/django/conformance/interleavings.py,sha256=5IEdeyAOI03vk8zR1DqpiQlw6d3Hfi6p61t4OWYxzO4,4669
42
+ due/django/conformance/observations.py,sha256=r9fl73XlptSptYucCcGl5jOqsKub2JPm27-GslsSDlc,12181
43
+ due/django/conformance/provider.py,sha256=2hDCxCfZ2KRp3mIEbCXj_OlNik3CzdqOefnIMEbkCf0,4675
44
+ due/django/conformance/recovery_isolation.py,sha256=SdFyOZuAfpSQaTh9__cnX4GQqQczTx75aMPRz0399Sk,13918
45
+ due/django/conformance/registrations.py,sha256=6Gu3v3YewsN0prRy8p3BjLfsEhXDCF_duhVkvZdRMi0,1911
46
+ due/django/conformance/reporting.py,sha256=PfcD-V_mnuovHrwCnEiFI6Lo5EKtb4ISXlzK9w0knNA,6232
47
+ due/django/conformance/scenarios.py,sha256=px_XzAjbsm84uBy0n4NVB69qjogiHC5tZOAFmCwmsuo,28003
48
+ due/django/conformance/seams.py,sha256=v3OBUMxjKSt57L0SbM0pN1c-EOcRH13whLhyKe-N5qU,19070
49
+ due/django/conformance/suite.py,sha256=25R7JWVSGROQVZVK4ITi7qseZquZJzCfWPO5wygAihE,3273
50
+ due/django/conformance/suite_collection.py,sha256=vJJQqmR5KshGU42bUFu0LOd3CgGv5ns1AaO5k3c9DBc,11729
51
+ due/django/conformance/worker_connection.py,sha256=rFC0U1TBu89rzoaIenLnHGJl8hWXUi610Up9mQowi1E,722
52
+ due/django/conformance/_internal/__init__.py,sha256=0gfot-Q-jLnASWx6DWkptbNry2AND4TJBrMOxQvjiQM,87
53
+ due/django/conformance/_internal/immutable_inputs.py,sha256=q_iaKKRA30JqAt0xMnF7NeeQnKeIhxjXUirDp0eGH4I,14823
54
+ due/django/conformance/_internal/suite.py,sha256=hURyjyq9nIFDjZWb7ZWe8qoed-OCcxqfhdYMEtss_q4,69834
55
+ due/django/declarations/__init__.py,sha256=nK4hx6veUnvtVr_mQSPxiN_mNJBqBAu6_IF6wyAajks,204
56
+ due/django/declarations/capture.py,sha256=ldDGf75aOzikiEI03Ceal-g0FUxUl4wasBFIzmqITKg,3227
57
+ due/django/declarations/dependents.py,sha256=Cwo7h9YpBGI4j1ncXKNsOqOSiYf5L9xsd54EVKTo7cg,733
58
+ due/django/declarations/eligibility.py,sha256=QfKNgM929mE7CPrm6HeMTbAUTkt7248ORN5veqjT6WQ,2069
59
+ due/django/declarations/external_services.py,sha256=pb9waiF9MELPeCWRgs2nRA-OWrK-eeGBiIlP-mkPtho,1984
60
+ due/django/declarations/mirrors.py,sha256=aeUTgMFYZS7H8BwLQeZOntQSX8xCW2xMN6_VftyOA7c,2929
61
+ due/django/evidence/__init__.py,sha256=6_x-QUy6Nx6OmxK6zluDOwiJMdkZQv3K-ZkwbuVcKes,181
62
+ due/django/evidence/attempts.py,sha256=UlcHAL4sDYLX7SLnUZbkoxtmK_TwaIAldZ6Ap86wlgU,12384
63
+ due/django/evidence/effect_evidence.py,sha256=EoUqNo-QT3lEvwBSFbaHS65SWbTCqVKMbdNtgM3AywM,4015
64
+ due/django/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
65
+ due/django/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
66
+ due/django/management/commands/due_check.py,sha256=-1k7Jij5F4rpy63Tk5hUAIXHgc-zF7_1NLoO2I8ockw,2267
67
+ due/django/management/commands/due_status.py,sha256=Zjl2unktLUGu7nom34G7HDQVKFX4RL72-8cxL0lERhM,4299
68
+ due/django/migrations/0001_initial.py,sha256=vlbYk4VCGgnyis8UqvZ5EPieXtxdLPagPobTOG8knx4,4572
69
+ due/django/migrations/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
70
+ due/django/runtime/__init__.py,sha256=YVyCgPggWhrrm_mALHPtaiI4PmLCliaSFSKwT7ce1pM,201
71
+ due/django/runtime/_delivery.py,sha256=IEhEmfKpHsB_h3RKpoE87hvbXFuD3qJJXgwzwUM3JuQ,6817
72
+ due/django/runtime/coordination.py,sha256=E69_KPhbxpaybH0cxTfduxu6wLmUWSofnWz3f7ap5QQ,43094
73
+ due/django/runtime/counters.py,sha256=nFj5la3IJXn9sbt_J9BQAZsEn-4uhbWRlONpAdZpXoc,1105
74
+ due/django/runtime/diagnostics.py,sha256=y8QdwznN_antirWYYS4iA7TlBqqehcB9qIXpRejUktw,3261
75
+ due/django/runtime/limits.py,sha256=6YucSGJI14xQT3uIz9m-DCCaHdqPBlS20pZoZQ7crCQ,226
76
+ due/django/runtime/metrics.py,sha256=kxeh34pgOJdZ0mSLS5mjeruB_q7oxbQB1avVGuXUzn8,10373
77
+ due/django/runtime/names.py,sha256=-WbLxYcU8bkx37jS4E9fxXL-K7zsXpQocc1_PpaJ6K0,602
78
+ due/django/runtime/recovery_pass.py,sha256=WrGeEeeLAh-uknOmBgkSDCyCavA0I7a-LLUfyVyFICg,24930
79
+ due/django/runtime/registry.py,sha256=GzNpqDVBRSoJm_yCy3O3BV6aa-qGeZPbExbSD3wfxBI,9255
80
+ due/django/runtime/tasks.py,sha256=qCGcK5e-16aDL7uQQUoafcVczHUuH9LyiD5UobuRsKo,2537
81
+ due/django/runtime/transport.py,sha256=gNRGR4NFasfsZKMY-4hSWu--CXBowAj77vFBO6iAZP4,2130
82
+ django_due-0.1.0.dist-info/METADATA,sha256=tQ7aHugWZ3gSY4j2jux6Xz7stEMsQkUmL541QTn2XL8,13429
83
+ django_due-0.1.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
84
+ django_due-0.1.0.dist-info/entry_points.txt,sha256=5MMgxknH6bsDcHwVB4kexq9vW7Vfjx6P5Hf9wV6Qrgg,47
85
+ django_due-0.1.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
86
+ django_due-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.4
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [pytest11]
2
+ due_work_tables = due.pytest_plugin
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
due/__init__.py ADDED
@@ -0,0 +1 @@
1
+ """Durable obligations for Python."""
due/_installed.py ADDED
@@ -0,0 +1,58 @@
1
+ """
2
+ A value the composition root installs at process start.
3
+
4
+ A library that has to reach application code at run time cannot import it: every importer of the library,
5
+ in every process and in the test selector's graph, would then depend on the application. The library
6
+ declares an ``Installed`` slot instead, ``the application startup hook`` installs the application's value, and
7
+ reading the slot in a process that never called ``wire()`` raises rather than silently doing nothing.
8
+ Tests that exercise the real value install it for a block with ``slot.installed(value)``. Unlike a model hook,
9
+ an unwired slot raises in the test session too, and callers resolve it outside any best-effort ``except``
10
+ so the error is not logged as a routine failure (project-conventions L8).
11
+ """
12
+
13
+ import weakref
14
+ from collections.abc import Iterator
15
+ from contextlib import contextmanager
16
+ from typing import Any
17
+
18
+
19
+ class NotInstalledError(RuntimeError):
20
+ """A process used something ``the application startup hook`` installs, without having called it."""
21
+
22
+
23
+ class Installed[T]:
24
+ """One installed value, read with ``get()``; ``value`` is ``None`` until ``install()``."""
25
+
26
+ def __init__(self, what: str, error: type[NotInstalledError] = NotInstalledError) -> None:
27
+ self.what = what
28
+ self.error = error
29
+ self.value: T | None = None
30
+ _slots.add(self)
31
+
32
+ def install(self, value: T) -> None:
33
+ """Install ``value``; installing again replaces it, so wiring is idempotent."""
34
+ self.value = value
35
+
36
+ def get(self) -> T:
37
+ if self.value is None:
38
+ raise self.error(f"{self.what} is not installed: this process never called the application startup hook")
39
+ return self.value
40
+
41
+ @contextmanager
42
+ def installed(self, value: T) -> Iterator[T]:
43
+ """Install ``value`` for the block, then restore whatever was installed before."""
44
+ previous = self.value
45
+ self.value = value
46
+ try:
47
+ yield value
48
+ finally:
49
+ self.value = previous
50
+
51
+
52
+ # Every slot alive in this process, so a test-isolation check can find them without importing their owners.
53
+ _slots: weakref.WeakSet[Installed[Any]] = weakref.WeakSet()
54
+
55
+
56
+ def all_slots() -> tuple[Installed[Any], ...]:
57
+ """Every installed slot that exists in this process."""
58
+ return tuple(_slots)