Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
2 changes: 1 addition & 1 deletion docs/adr/0001-expose-installs-into-modules-only.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Loading