Skip to content

Conversation

@Kludex
Copy link
Member

@Kludex Kludex commented Dec 18, 2025

Closes #3710


Note

Adjust CI to use lowest-direct installs and expand Python matrix, bump a few dependency pins, and harden tests with guarded imports and minor fixes.

  • CI:
    • Use uv sync --group dev first and --resolution lowest-direct for lowest-versions; run pytest with --no-sync.
    • Expand Python matrix to include 3.11; increase test-lowest-versions timeout to 35m; set UV_FROZEN="0" for lowest runs.
  • Dependencies:
    • Pin exceptiongroup>=1.2.2 (py<3.11).
    • Tighten optional deps: pillow>11.0.0, torch>=2.8.0, vllm>=0.8.0, and boto3-stubs[bedrock-runtime]>=1.40.64.
  • Tests/Typing:
    • Guard vendor imports with try_import() and move some imports under TYPE_CHECKING.
    • Bedrock tests parametrize geo prefixes safely when package missing.
    • Google error test now parameterizes error class by name via getattr.
    • Minor refactors in HuggingFace/Anthropic/UI tests and small formatting in create_web_app HTML response.

Written by Cursor Bugbot for commit 48b6562. This will update automatically on new commits. Configure here.

@github-actions
Copy link

github-actions bot commented Dec 18, 2025

Docs Preview

commit: 48b6562
Preview URL: https://34d41ff6-pydantic-ai-previews.pydantic.workers.dev

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on January 9

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

outlines-transformers = ["outlines[transformers]>=1.0.0, <1.3.0; (sys_platform != 'darwin' or platform_machine != 'x86_64')", "transformers>=4.0.0", "pillow", "torch; (sys_platform != 'darwin' or platform_machine != 'x86_64')"]
outlines-llamacpp = ["outlines[llamacpp]>=1.0.0, <1.3.0"]
outlines-mlxlm = ["outlines[mlxlm]>=1.0.0, <1.3.0; platform_system == 'Darwin' and platform_machine == 'arm64'"]
outlines-sglang = ["outlines[sglang]>=1.0.0, <1.3.0", "pillow"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Inconsistent version specifier excludes Pillow 11.0.0

The pillow>11.0.0 constraint uses an exclusive lower bound (>) while all other version constraints in the file consistently use inclusive bounds (>=). In the same PR, vllm>=0.8.0 uses >=. Since Pillow has no version between 11.0.0 and 11.1.0, this effectively sets the minimum to 11.1.0, potentially excluding a valid version. If the intent was to require Pillow 11.0.0 or later, this appears to be a typo and >=11.0.0 would be the correct specifier.

Fix in Cursor Fix in Web


AsyncAnthropicClient: TypeAlias = AsyncAnthropic | AsyncAnthropicBedrock | AsyncAnthropicVertex
if TYPE_CHECKING:
AsyncAnthropicClient: TypeAlias = AsyncAnthropic | AsyncAnthropicBedrock | AsyncAnthropicVertex
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Type alias moved to TYPE_CHECKING breaks runtime import

The AsyncAnthropicClient type alias is now only defined under if TYPE_CHECKING:, but pydantic_ai/models/anthropic.py performs a runtime import with from ..providers.anthropic import AsyncAnthropicClient at line 49. Since TYPE_CHECKING is False at runtime, this import will fail with an ImportError, completely breaking the Anthropic model functionality.

Fix in Cursor Fix in Web


- run: uv sync --only-dev

- run: uv run mcp-run-python example --deps=numpy
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DouweM is this still needed now that we have the mcp-run-python in another repo? I've already checked that this test is also ran on that repo.

Copy link
Collaborator

@DouweM DouweM Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kludex I'm fine removing it.

Note that we also test that it mcp-run-python be started here:

from pydantic_ai import Agent
from pydantic_ai.mcp import MCPServerStdio
server = MCPServerStdio( # (1)!
'uv', args=['run', 'mcp-run-python', 'stdio'], timeout=10
)
agent = Agent('openai:gpt-5', toolsets=[server])
async def main():
result = await agent.run('How many days between 2000-01-01 and 2025-03-18?')
print(result.output)
#> There are 9,208 days between January 1, 2000, and March 18, 2025.

That makes the test suite require deno. I actually think we should drop that entirely and really treat it as a separate package.


- run: mkdir .coverage

- run: uv sync --only-dev
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also move the ${{ matrix.install.command }} here and make the test command uv run --no-sync ...?

@DouweM
Copy link
Collaborator

DouweM commented Dec 18, 2025

Some warnings from the lowest-versions job:

warning: The direct dependency `boto3-stubs` is unpinned. Consider setting a lower bound when using `--resolution lowest` or `--resolution lowest-direct` to avoid using outdated versions.
warning: The direct dependency `exceptiongroup` is unpinned. Consider setting a lower bound when using `--resolution lowest` or `--resolution lowest-direct` to avoid using outdated versions.
warning: The direct dependency `torch` is unpinned. Consider setting a lower bound when using `--resolution lowest` or `--resolution lowest-direct` to avoid using outdated versions.
warning: The package `boto3-stubs==0.1.8` does not have an extra named `bedrock-runtime`


- run: uv run mcp-run-python example --deps=numpy
# We install the `--group dev` first because if we use `--package` together, it will try to install the `dev` group from the package.
- run: uv sync --group dev
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding matrix.install.command here didn't work?

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.

lowest-versions CI jobs are not actually testing lowest package versions

3 participants