Skip to content

refactor(adapters): remove Any from the CLI, web, MCP and tracing adapters - #794

Merged
janbjorge merged 2 commits into
mainfrom
typing/06-adapters-no-any
Sep 6, 2026
Merged

refactor(adapters): remove Any from the CLI, web, MCP and tracing adapters#794
janbjorge merged 2 commits into
mainfrom
typing/06-adapters-no-any

Conversation

@janbjorge

Copy link
Copy Markdown
Owner

Part 6/9 of the strict-mypy series. Stacked on #793; merge in order, I rebase the rest after each merge.

The CLI factory loader returns a Factory protocol (a callable taking
*args: object) and raises TypeError when a module:attr path does
not resolve to a callable; validate_factory_result() yields object
and the supervisor and pgq commands narrow with isinstance, so a
factory yielding the wrong type fails with a clear TypeError instead
of an AttributeError later. The web broadcaster dependency, the basic
auth dependency, the MCP server's FastMCP generic and the
OpenTelemetry tracer field get their real types, and the executor
callable probes take object and guard with callable().

@janbjorge
janbjorge force-pushed the typing/06-adapters-no-any branch from 68427f3 to 1ba395f Compare September 6, 2026 16:37
@janbjorge
janbjorge force-pushed the typing/06-adapters-no-any branch from 1ba395f to 20a542d Compare September 6, 2026 17:48
@janbjorge
janbjorge force-pushed the typing/06-adapters-no-any branch 2 times, most recently from 071c251 to 4ea393f Compare September 6, 2026 18:24
@janbjorge
janbjorge force-pushed the typing/06-adapters-no-any branch from 4ea393f to 3916418 Compare September 6, 2026 18:31
@janbjorge
janbjorge force-pushed the typing/06-adapters-no-any branch from 3916418 to a8bc86b Compare September 6, 2026 18:33
Base automatically changed from typing/05-job-headers to main September 6, 2026 18:38
…pters

The CLI factory loader returns a Factory protocol (a callable taking
`*args: object`) and raises TypeError when a `module:attr` path does
not resolve to a callable; validate_factory_result() yields `object`
and the supervisor and `pgq` commands narrow with isinstance, so a
factory yielding the wrong type fails with a clear TypeError instead
of an AttributeError later. The web broadcaster dependency, the basic
auth dependency, the MCP server's FastMCP generic and the
OpenTelemetry tracer field get their real types, and the executor
callable probes take `object` and guard with callable().
@janbjorge
janbjorge force-pushed the typing/06-adapters-no-any branch from a8bc86b to 22a27e4 Compare September 6, 2026 18:38
@janbjorge
janbjorge merged commit 16aac29 into main Sep 6, 2026
19 of 20 checks passed
@janbjorge
janbjorge deleted the typing/06-adapters-no-any branch September 6, 2026 18:41
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.

1 participant