Skip to content

fix: test the dependency floors, and import each adapter only when it is used - #89

Merged
TMHSDigital merged 1 commit into
mainfrom
fix/dependency-floors
Sep 24, 2026
Merged

TMHSDigital merged 1 commit into
mainfrom
fix/dependency-floors

Conversation

@TMHSDigital

Copy link
Copy Markdown
Owner

Fixes #47.

Floors. Each floor in pyproject is now the oldest release the whole suite passes on, found by bisecting PyPI and confirmed with a lowest-direct lock:

package was now why
scipy >=1.14 >=1.14.1 1.14.0 has no Python 3.13 wheel
typer >=0.15 >=0.16 0.15 breaks against click 8.2
typesafe-sdk >=0.1 >=0.5.7,<0.8 older releases lack the client the adapter uses
anthropic >=0.40 >=0.77,<2 older releases lack OutputConfigParam
httpx >=0.28 removed nothing imports it

The dev group gains click>=8.2, which the CLI tests need to read stderr apart from stdout.

CI. A new job, "the oldest dependencies pyproject allows", runs uv lock --resolution lowest-direct, then uv sync --frozen, then pytest on Python 3.12. It has to lock first: uv sync --resolution keeps an existing lockfile that already satisfies pyproject, so on its own it quietly installs the newest releases.

Lazy adapters. Until now the registry imported all four adapters at startup, so a broken anthropic install stopped the mock from working too. Now:

  • Built-ins register by module and class, and each one is imported on its first create.
  • A failed import raises PlumblineError, naming both the adapter and the missing module.
  • available() lists every adapter without importing any of them.
  • plumbline.adapters loads its adapter classes on first access.

A new test runs a subprocess with anthropic blocked. In it the mock still works, and generative fails with a one-line error.

Checks: ruff, format, mypy --strict and pytest all pass on the locked versions, and pytest passes on the lowest resolution (numpy 2.1.0, scipy 1.14.1, typer 0.16.0, click 8.2.0, typesafe-sdk 0.5.7, anthropic 0.77.0, pytest 8.3.0).

🤖 Generated with Claude Code

… is used

The floors in pyproject were never installed together, and three were
wrong: scipy 1.14.0 has no Python 3.13 wheel, anthropic before 0.77 lacks
the structured output types, and typer before 0.16 breaks on click 8.2.
They are now the oldest releases the suite passes on, the SDKs are capped
below their next breaking series, httpx is dropped (nothing imported it),
and a CI job runs the suite on the lowest direct resolution.

The registry imported every adapter at startup, so one broken SDK took
down the mock too. Built-ins are now imported on first create, and a
failed import names the module and the adapter.

Fixes #47.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@TMHSDigital
TMHSDigital merged commit b67e098 into main Sep 24, 2026
18 checks passed
@TMHSDigital
TMHSDigital deleted the fix/dependency-floors branch September 24, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dependency floors are wrong, and one bad import breaks the whole CLI

1 participant