diff --git a/AGENTS.md b/AGENTS.md index 3fd11be..106d94d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,13 +6,13 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co `modern-di-pytest` is a pytest adapter over [`modern-di`](https://github.com/modern-python/modern-di); [`CONTEXT.md`](CONTEXT.md) opens with -what it does and owns the vocabulary — read it before naming a concept in code, a test name, or an +what it does and owns the vocabulary. Read it before naming a concept in code, a test name, or an issue title. It is one of that project's integrations, each of which lives in a separate repository and ships as a separate PyPI package. ## Commands -`just` (task runner) and `uv` (package manager). The [`justfile`](justfile) is the source of truth — +`just` (task runner) and `uv` (package manager). The [`justfile`](justfile) is the source of truth: `just --list`, or read it. ## Architecture diff --git a/CONTEXT.md b/CONTEXT.md index 9e66a3e..6614bb9 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -10,14 +10,14 @@ A term is listed only when there is a synonym to reject, or a meaning subtle eno docs must agree on it. General programming vocabulary does not belong here, however heavily this package uses it. -The domain terms are `modern-di`'s — `Container`, `Provider`, `Group`, `Scope`, `Resolution`, +The domain terms are `modern-di`'s: `Container`, `Provider`, `Group`, `Scope`, `Resolution`, `Override`. That project's `CONTEXT.md` is the authority for all of them; nothing here redefines one. The three below are this package's own. **Install**: Binding a generated fixture onto a module as a module-level attribute, which is what makes pytest collect it. `expose()` installs; `modern_di_fixture()` returns a fixture the caller assigns itself. -_Avoid_: inject, register — both have been used for this in the same breath as `install`, and +_Avoid_: inject, register. Both have been used for this in the same breath as `install`, and `inject` additionally collides with the DI sense of injection, which is `modern-di`'s word for passing a resolved value into a callable. @@ -27,6 +27,6 @@ at import time. **Container fixture**: The user's own pytest fixture yielding the `modern_di.Container` a generated fixture resolves -from — named by `container_fixture=`, defaulting to `di_container`. This package never defines one; +from, named by `container_fixture=` and defaulting to `di_container`. This package never defines one; pointing a fixture at a child scope means naming a different container fixture, not a different package API. diff --git a/docs/adr/0001-expose-installs-into-modules-only.md b/docs/adr/0001-expose-installs-into-modules-only.md index 3a28c65..657d70b 100644 --- a/docs/adr/0001-expose-installs-into-modules-only.md +++ b/docs/adr/0001-expose-installs-into-modules-only.md @@ -6,7 +6,7 @@ module. The decision half already lives in the private, pure `_collect_fixtures` proposal is to extract the install half too, wrapping the `name -> provider` mapping in a `FixtureSet` exposing `.install(into=...)`. We will not, because a seam needs two adapters and the only install targets are the caller's module, located via `inspect.stack()`, and an explicit -`module=`, both `types.ModuleType` - one adapter exercised with two instances. Deleting a +`module=`, both `types.ModuleType`, which is one adapter exercised with two instances. Deleting a `FixtureSet` would bring back no complexity, since its `setattr` loop simply inlines, so the install step stays that loop and the public surface stays at `expose` and `modern_di_fixture`. A genuinely different install target, such as a pytest class namespace, is what would make the seam real.