You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
workflow extra's anyio<4.7 pin blocks the mcp extra (anyio>=4.9) #139
osw[workflow] and osw[mcp] cannot be installed into the same environment.
osw[workflow] pins anyio>=4.4.0,<4.7
mcp>=2 requires anyio>=4.9 (anyio>=4.10 on Python 3.14+)
No anyio version satisfies both, so uv lock fails when both extras are resolvable together.
Why the anyio cap exists
prefect 2.20.25's GatherTaskGroup subclasses anyio's TaskGroup but does not
implement create_task, which newer anyio made abstract. Broken on anyio 4.14,
verified good on 4.6.2. prefect 2.20.25 is the final 2.x release, so no backport
is coming.
[tool.uv] conflicts declares the mcp extra mutually exclusive with both the workflow extra and the dev dependency-group.
mcp is excluded from the all extra and from the dev group, so the default
resolution keeps the workflow-compatible anyio.
The dev group lists prefect and anyio directly instead of inheriting them
from osw[workflow]. Being in a conflict set, a self-referential osw[workflow]
entry would only activate under --extra workflow, leaving a bare uv sync on
anyio 4.14 (the version that breaks prefect). These pins now have to be kept in
sync with the workflow extra by hand.
The pytest stack moved into its own test group, since dev conflicts with the mcp extra and there would otherwise be no environment containing both pytest
and mcp.
src/osw/mcp is excluded from ty, since its imports are unresolvable in the
default dev environment.
The MCP unit tests use importorskip, so they skip in the default suite.
Cost
The MCP server module is neither type-checked nor unit-tested in the default
environment. Its tests pass (32 passed against mcp==2.0.0) but only when run
explicitly:
uv sync --extra mcp --group test --no-dev
uv run --extra mcp --group test --no-dev --no-sync python -m pytest tests/test_mcp_*.py
CI does not currently run that second environment.
What to check
Whether the anyio cap is still needed, either because a newer anyio restored the
non-abstract create_task path, or because the workflow extra can move to
prefect 3.x. If the cap can be lifted, revert all six workarounds above and put mcp back into all and dev.
TypeError: Can't instantiate abstract class GatherTaskGroup
The break is exactly at 4.14.0, which added create_task() to the TaskGroup ABC and changed start_soon() to return a TaskHandle (anyio changelog, agronholm/anyio#1098). That promoted create_task into the abstract set, so prefect's external subclass can no longer be instantiated. Not reverted in 4.14.1 or 4.14.2.
This resolves the conflict
mcp 2.1.1 requires anyio>=4.9. Its stricter anyio>=4.10 clause is gated on python_version >= '3.14', and osw is requires-python = ">=3.10,<3.14", so that clause never applies here.
That leaves a non-empty window: anyio>=4.9,<4.14. Verified by co-resolving all three:
workflow tests pass (test_notify_teams, test_tags_str_to_list, test_deploy_serve); test_deploy_runner is skipped by a pre-existing unconditional marker
Follow-up on feat/mcp-server
Five of the six workarounds from #133 become unnecessary once this lands:
[tool.uv] conflicts (mcp vs workflow, mcp vs dev)
mcp excluded from the all extra
dev listing prefect/anyio directly instead of osw[workflow] (removes the hand-sync hazard)
the separate test group, which existed only because dev conflicted with the mcp extra
the importorskip guards in the MCP tests
The sixth (the ty exclude for src/osw/mcp) is already undone on that branch.
Activity
feat(mcp): port server to mcp 2.x and isolate the extra
build: type-check src/osw/mcp instead of excluding it
LukasGold commentedon Aug 28, 2026
The cap is still needed, but
<4.7is seven minors too tightBisected
prefect==2.20.25against every anyio minor (py3.12, exercising prefect's owngather()):GatherTaskGroup.__abstractmethods__[]['create_task']TypeError: Can't instantiate abstract class GatherTaskGroupThe break is exactly at 4.14.0, which added
create_task()to theTaskGroupABC and changedstart_soon()to return aTaskHandle(anyio changelog, agronholm/anyio#1098). That promotedcreate_taskinto the abstract set, so prefect's external subclass can no longer be instantiated. Not reverted in 4.14.1 or 4.14.2.This resolves the conflict
mcp 2.1.1requiresanyio>=4.9. Its stricteranyio>=4.10clause is gated onpython_version >= '3.14', and osw isrequires-python = ">=3.10,<3.14", so that clause never applies here.That leaves a non-empty window:
anyio>=4.9,<4.14. Verified by co-resolving all three:No move to prefect 3.x is required, and no osw-python code change is required.
Verified
Branch
fix/widen-anyio-pinchanges theworkflowextra toanyio>=4.9,<4.14:uv lockresolves,anyio 4.6.2.post1 -> 4.13.0, prefect stays 2.20.25test_notify_teams,test_tags_str_to_list,test_deploy_serve);test_deploy_runneris skipped by a pre-existing unconditional markerFollow-up on feat/mcp-server
Five of the six workarounds from #133 become unnecessary once this lands:
[tool.uv] conflicts(mcp vs workflow, mcp vs dev)mcpexcluded from theallextradevlistingprefect/anyiodirectly instead ofosw[workflow](removes the hand-sync hazard)testgroup, which existed only becausedevconflicted with themcpextraimportorskipguards in the MCP testsThe sixth (the
tyexclude forsrc/osw/mcp) is already undone on that branch.feat: an osw CLI and an MCP server for live OSL instances (#133)