pydantic-ai 0.0.46__tar.gz → 0.0.48__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pydantic-ai might be problematic. Click here for more details.

Files changed (138) hide show
  1. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/Makefile +8 -0
  2. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/PKG-INFO +4 -4
  3. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/pyproject.toml +60 -16
  4. pydantic_ai-0.0.48/tests/evals/test_dataset.py +994 -0
  5. pydantic_ai-0.0.48/tests/evals/test_evaluator_base.py +290 -0
  6. pydantic_ai-0.0.48/tests/evals/test_evaluator_common.py +354 -0
  7. pydantic_ai-0.0.48/tests/evals/test_evaluator_context.py +104 -0
  8. pydantic_ai-0.0.48/tests/evals/test_evaluator_spec.py +127 -0
  9. pydantic_ai-0.0.48/tests/evals/test_evaluators.py +529 -0
  10. pydantic_ai-0.0.48/tests/evals/test_llm_as_a_judge.py +110 -0
  11. pydantic_ai-0.0.48/tests/evals/test_otel.py +882 -0
  12. pydantic_ai-0.0.48/tests/evals/test_render_numbers.py +111 -0
  13. pydantic_ai-0.0.48/tests/evals/test_reporting.py +380 -0
  14. pydantic_ai-0.0.48/tests/evals/test_reports.py +264 -0
  15. pydantic_ai-0.0.48/tests/evals/test_utils.py +150 -0
  16. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/json_body_serializer.py +6 -5
  17. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_openai/test_user_id.yaml +4 -4
  18. pydantic_ai-0.0.48/tests/models/cassettes/test_openai_responses/test_audio_as_binary_content_input.yaml +57 -0
  19. pydantic_ai-0.0.48/tests/models/cassettes/test_openai_responses/test_image_as_binary_content_input.yaml +95 -0
  20. pydantic_ai-0.0.48/tests/models/cassettes/test_openai_responses/test_openai_responses_document_as_binary_content_input.yaml +95 -0
  21. pydantic_ai-0.0.48/tests/models/cassettes/test_openai_responses/test_openai_responses_document_url_input.yaml +374 -0
  22. pydantic_ai-0.0.48/tests/models/cassettes/test_openai_responses/test_openai_responses_image_url_input.yaml +95 -0
  23. pydantic_ai-0.0.48/tests/models/cassettes/test_openai_responses/test_openai_responses_model_http_error.yaml +53 -0
  24. pydantic_ai-0.0.48/tests/models/cassettes/test_openai_responses/test_openai_responses_model_retry.yaml +259 -0
  25. pydantic_ai-0.0.48/tests/models/cassettes/test_openai_responses/test_openai_responses_model_simple_response.yaml +90 -0
  26. pydantic_ai-0.0.48/tests/models/cassettes/test_openai_responses/test_openai_responses_model_simple_response_with_tool_call.yaml +240 -0
  27. pydantic_ai-0.0.48/tests/models/cassettes/test_openai_responses/test_openai_responses_reasoning_effort.yaml +110 -0
  28. pydantic_ai-0.0.48/tests/models/cassettes/test_openai_responses/test_openai_responses_result_type.yaml +123 -0
  29. pydantic_ai-0.0.48/tests/models/cassettes/test_openai_responses/test_openai_responses_stream.yaml +211 -0
  30. pydantic_ai-0.0.48/tests/models/cassettes/test_openai_responses/test_openai_responses_system_prompt.yaml +90 -0
  31. pydantic_ai-0.0.48/tests/models/cassettes/test_openai_responses/test_openai_responses_text_document_url_input.yaml +159 -0
  32. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/test_fallback.py +7 -48
  33. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/test_model.py +2 -2
  34. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/test_model_function.py +1 -1
  35. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/test_model_names.py +1 -1
  36. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/test_openai.py +1 -1
  37. pydantic_ai-0.0.48/tests/models/test_openai_responses.py +288 -0
  38. pydantic_ai-0.0.48/tests/providers/__init__.py +0 -0
  39. pydantic_ai-0.0.48/tests/providers/cassettes/test_google_vertex/test_vertexai_provider.yaml +107 -0
  40. pydantic_ai-0.0.48/tests/providers/test_bedrock.py +34 -0
  41. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/providers/test_google_vertex.py +30 -0
  42. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/test_agent.py +21 -7
  43. pydantic_ai-0.0.48/tests/test_cli.py +78 -0
  44. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/test_examples.py +120 -13
  45. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/test_live.py +7 -8
  46. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/test_logfire.py +10 -13
  47. pydantic_ai-0.0.48/tests/test_settings.py +26 -0
  48. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/test_streaming.py +2 -1
  49. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/test_tools.py +1 -2
  50. pydantic_ai-0.0.46/tests/providers/test_bedrock.py +0 -17
  51. pydantic_ai-0.0.46/tests/test_cli.py +0 -49
  52. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/.gitignore +0 -0
  53. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/LICENSE +0 -0
  54. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/README.md +0 -0
  55. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/__init__.py +0 -0
  56. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/assets/dummy.pdf +0 -0
  57. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/assets/kiwi.png +0 -0
  58. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/assets/marcelo.mp3 +0 -0
  59. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/cassettes/test_mcp/test_agent_with_stdio_server.yaml +0 -0
  60. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/conftest.py +0 -0
  61. {pydantic_ai-0.0.46/tests/graph → pydantic_ai-0.0.48/tests/evals}/__init__.py +0 -0
  62. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/example_modules/README.md +0 -0
  63. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/example_modules/bank_database.py +0 -0
  64. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/example_modules/fake_database.py +0 -0
  65. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/example_modules/weather_service.py +0 -0
  66. {pydantic_ai-0.0.46/tests/models → pydantic_ai-0.0.48/tests/graph}/__init__.py +0 -0
  67. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/graph/test_file_persistence.py +0 -0
  68. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/graph/test_graph.py +0 -0
  69. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/graph/test_mermaid.py +0 -0
  70. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/graph/test_persistence.py +0 -0
  71. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/graph/test_state.py +0 -0
  72. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/graph/test_utils.py +0 -0
  73. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/import_examples.py +0 -0
  74. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/mcp_server.py +0 -0
  75. {pydantic_ai-0.0.46/tests/providers → pydantic_ai-0.0.48/tests/models}/__init__.py +0 -0
  76. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_anthropic/test_document_binary_content_input.yaml +0 -0
  77. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_anthropic/test_document_url_input.yaml +0 -0
  78. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_anthropic/test_image_url_input.yaml +0 -0
  79. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_anthropic/test_image_url_input_invalid_mime_type.yaml +0 -0
  80. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_anthropic/test_multiple_parallel_tool_calls.yaml +0 -0
  81. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_anthropic/test_text_document_url_input.yaml +0 -0
  82. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_bedrock/test_bedrock_model.yaml +0 -0
  83. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_bedrock/test_bedrock_model_anthropic_model_without_tools.yaml +0 -0
  84. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_bedrock/test_bedrock_model_iter_stream.yaml +0 -0
  85. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_bedrock/test_bedrock_model_max_tokens.yaml +0 -0
  86. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_bedrock/test_bedrock_model_retry.yaml +0 -0
  87. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_bedrock/test_bedrock_model_stream.yaml +0 -0
  88. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_bedrock/test_bedrock_model_structured_response.yaml +0 -0
  89. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_bedrock/test_bedrock_model_top_p.yaml +0 -0
  90. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_bedrock/test_document_url_input.yaml +0 -0
  91. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_bedrock/test_image_as_binary_content_input.yaml +0 -0
  92. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_bedrock/test_image_url_input.yaml +0 -0
  93. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_bedrock/test_text_as_binary_content_input.yaml +0 -0
  94. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_bedrock/test_text_document_url_input.yaml +0 -0
  95. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_cohere/test_request_simple_success_with_vcr.yaml +0 -0
  96. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_gemini/test_document_url_input.yaml +0 -0
  97. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_gemini/test_image_as_binary_content_input.yaml +0 -0
  98. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_gemini/test_image_url_input.yaml +0 -0
  99. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_groq/test_image_as_binary_content_input.yaml +0 -0
  100. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_groq/test_image_url_input.yaml +0 -0
  101. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_openai/test_audio_as_binary_content_input.yaml +0 -0
  102. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_openai/test_document_url_input.yaml +0 -0
  103. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_openai/test_image_as_binary_content_input.yaml +0 -0
  104. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_openai/test_max_completion_tokens[gpt-4.5-preview].yaml +0 -0
  105. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_openai/test_max_completion_tokens[gpt-4o-mini].yaml +0 -0
  106. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_openai/test_max_completion_tokens[o3-mini].yaml +0 -0
  107. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_openai/test_multiple_agent_tool_calls.yaml +0 -0
  108. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_openai/test_openai_o1_mini_system_role[developer].yaml +0 -0
  109. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/cassettes/test_openai/test_openai_o1_mini_system_role[system].yaml +0 -0
  110. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/mock_async_stream.py +0 -0
  111. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/test_anthropic.py +0 -0
  112. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/test_bedrock.py +0 -0
  113. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/test_cohere.py +0 -0
  114. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/test_gemini.py +0 -0
  115. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/test_groq.py +0 -0
  116. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/test_instrumented.py +0 -0
  117. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/test_mistral.py +0 -0
  118. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/models/test_model_test.py +0 -0
  119. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/providers/cassettes/test_azure/test_azure_provider_call.yaml +0 -0
  120. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/providers/test_anthropic.py +0 -0
  121. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/providers/test_azure.py +0 -0
  122. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/providers/test_cohere.py +0 -0
  123. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/providers/test_deepseek.py +0 -0
  124. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/providers/test_google_gla.py +0 -0
  125. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/providers/test_groq.py +0 -0
  126. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/providers/test_mistral.py +0 -0
  127. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/providers/test_openai.py +0 -0
  128. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/providers/test_provider_names.py +0 -0
  129. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/test_deps.py +0 -0
  130. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/test_format_as_xml.py +0 -0
  131. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/test_json_body_serializer.py +0 -0
  132. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/test_mcp.py +0 -0
  133. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/test_messages.py +0 -0
  134. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/test_parts_manager.py +0 -0
  135. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/test_usage_limits.py +0 -0
  136. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/test_utils.py +0 -0
  137. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/typed_agent.py +0 -0
  138. {pydantic_ai-0.0.46 → pydantic_ai-0.0.48}/tests/typed_graph.py +0 -0
@@ -13,6 +13,14 @@ install: .uv .pre-commit ## Install the package, dependencies, and pre-commit fo
13
13
  uv sync --frozen --all-extras --all-packages --group lint --group docs
14
14
  pre-commit install --install-hooks
15
15
 
16
+ .PHONY: install-all-python
17
+ install-all-python: ## Install and synchronize an interpreter for every python version
18
+ UV_PROJECT_ENVIRONMENT=.venv39 uv sync --python 3.9 --frozen --all-extras --all-packages --group lint --group docs
19
+ UV_PROJECT_ENVIRONMENT=.venv310 uv sync --python 3.10 --frozen --all-extras --all-packages --group lint --group docs
20
+ UV_PROJECT_ENVIRONMENT=.venv311 uv sync --python 3.11 --frozen --all-extras --all-packages --group lint --group docs
21
+ UV_PROJECT_ENVIRONMENT=.venv312 uv sync --python 3.12 --frozen --all-extras --all-packages --group lint --group docs
22
+ UV_PROJECT_ENVIRONMENT=.venv313 uv sync --python 3.13 --frozen --all-extras --all-packages --group lint --group docs
23
+
16
24
  .PHONY: sync
17
25
  sync: .uv ## Update local packages and uv.lock
18
26
  uv sync --all-extras --all-packages --group lint --group docs
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydantic-ai
3
- Version: 0.0.46
3
+ Version: 0.0.48
4
4
  Summary: Agent Framework / shim to use Pydantic with LLMs
5
5
  Project-URL: Homepage, https://ai.pydantic.dev
6
6
  Project-URL: Source, https://github.com/pydantic/pydantic-ai
@@ -28,11 +28,11 @@ Classifier: Topic :: Internet
28
28
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
29
29
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
30
30
  Requires-Python: >=3.9
31
- Requires-Dist: pydantic-ai-slim[anthropic,bedrock,cli,cohere,groq,mcp,mistral,openai,vertexai]==0.0.46
31
+ Requires-Dist: pydantic-ai-slim[anthropic,bedrock,cli,cohere,evals,groq,mcp,mistral,openai,vertexai]==0.0.48
32
32
  Provides-Extra: examples
33
- Requires-Dist: pydantic-ai-examples==0.0.46; extra == 'examples'
33
+ Requires-Dist: pydantic-ai-examples==0.0.48; extra == 'examples'
34
34
  Provides-Extra: logfire
35
- Requires-Dist: logfire>=2.3; extra == 'logfire'
35
+ Requires-Dist: logfire>=3.11.0; extra == 'logfire'
36
36
  Description-Content-Type: text/markdown
37
37
 
38
38
  <div align="center">
@@ -1,10 +1,18 @@
1
1
  [build-system]
2
- requires = ["hatchling"]
2
+ requires = ["hatchling", "uv-dynamic-versioning>=0.7.0"]
3
3
  build-backend = "hatchling.build"
4
4
 
5
+ [tool.hatch.version]
6
+ source = "uv-dynamic-versioning"
7
+
8
+ [tool.uv-dynamic-versioning]
9
+ vcs = "git"
10
+ style = "pep440"
11
+ bump = true
12
+
5
13
  [project]
6
14
  name = "pydantic-ai"
7
- version = "0.0.46"
15
+ dynamic = ["version", "dependencies", "optional-dependencies"]
8
16
  description = "Agent Framework / shim to use Pydantic with LLMs"
9
17
  authors = [
10
18
  { name = "Samuel Colvin", email = "samuel@pydantic.dev" },
@@ -35,32 +43,44 @@ classifiers = [
35
43
  "Framework :: Pydantic :: 2",
36
44
  ]
37
45
  requires-python = ">=3.9"
46
+
47
+ [tool.hatch.metadata.hooks.uv-dynamic-versioning]
38
48
  dependencies = [
39
- "pydantic-ai-slim[openai,vertexai,groq,anthropic,mistral,cohere,bedrock,cli,mcp]==0.0.46",
49
+ "pydantic-ai-slim[openai,vertexai,groq,anthropic,mistral,cohere,bedrock,cli,mcp,evals]=={{ version }}",
40
50
  ]
41
51
 
52
+ [tool.hatch.metadata.hooks.uv-dynamic-versioning.optional-dependencies]
53
+ examples = ["pydantic-ai-examples=={{ version }}"]
54
+ logfire = ["logfire>=3.11.0"]
55
+
42
56
  [project.urls]
43
57
  Homepage = "https://ai.pydantic.dev"
44
58
  Source = "https://github.com/pydantic/pydantic-ai"
45
59
  Documentation = "https://ai.pydantic.dev"
46
60
  Changelog = "https://github.com/pydantic/pydantic-ai/releases"
47
61
 
48
- [project.optional-dependencies]
49
- examples = ["pydantic-ai-examples==0.0.46"]
50
- logfire = ["logfire>=2.3"]
62
+ [project.scripts]
63
+ pai = "pydantic_ai._cli:app"
51
64
 
52
65
  [tool.uv.sources]
53
66
  pydantic-ai-slim = { workspace = true }
67
+ pydantic-evals = { workspace = true }
54
68
  pydantic-graph = { workspace = true }
55
69
  pydantic-ai-examples = { workspace = true }
56
70
  mcp-run-python = { workspace = true }
57
71
 
58
72
  [tool.uv.workspace]
59
- members = ["pydantic_ai_slim", "pydantic_graph", "examples", "mcp-run-python"]
73
+ members = [
74
+ "pydantic_ai_slim",
75
+ "pydantic_evals",
76
+ "pydantic_graph",
77
+ "mcp-run-python",
78
+ "examples",
79
+ ]
60
80
 
61
81
  [dependency-groups]
62
82
  # dev dependencies are defined in `pydantic-ai-slim/pyproject.toml` to allow for minimal testing
63
- lint = ["mypy>=1.11.2", "pyright>=1.1.388,<1.1.390", "ruff>=0.6.9"]
83
+ lint = ["mypy>=1.11.2", "pyright>=1.1.390", "ruff>=0.6.9"]
64
84
  docs = [
65
85
  "black>=24.10.0",
66
86
  "bs4>=0.0.2",
@@ -83,15 +103,25 @@ line-length = 120
83
103
  target-version = "py39"
84
104
  include = [
85
105
  "pydantic_ai_slim/**/*.py",
86
- "mcp-run-python/**/*.py",
106
+ "pydantic_evals/**/*.py",
87
107
  "pydantic_graph/**/*.py",
108
+ "mcp-run-python/**/*.py",
88
109
  "examples/**/*.py",
89
110
  "tests/**/*.py",
90
111
  "docs/**/*.py",
91
112
  ]
92
113
 
93
114
  [tool.ruff.lint]
94
- extend-select = ["Q", "RUF100", "C90", "UP", "I", "D", "TID251"]
115
+ extend-select = [
116
+ "Q",
117
+ "RUF100",
118
+ "RUF018", # https://docs.astral.sh/ruff/rules/assignment-in-assert/
119
+ "C90",
120
+ "UP",
121
+ "I",
122
+ "D",
123
+ "TID251",
124
+ ]
95
125
  flake8-quotes = { inline-quotes = "single", multiline-quotes = "double" }
96
126
  isort = { combine-as-imports = true, known-first-party = ["pydantic_ai"] }
97
127
  mccabe = { max-complexity = 15 }
@@ -115,10 +145,10 @@ docstring-code-format = false
115
145
  quote-style = "single"
116
146
 
117
147
  [tool.ruff.lint.per-file-ignores]
148
+ "mcp-run-python/**/*.py" = ["D", "TID251"]
149
+ "examples/**/*.py" = ["D101", "D103"]
118
150
  "tests/**/*.py" = ["D"]
119
151
  "docs/**/*.py" = ["D"]
120
- "examples/**/*.py" = ["D101", "D103"]
121
- "mcp-run-python/**/*.py" = ["D", "TID251"]
122
152
 
123
153
  [tool.pyright]
124
154
  pythonVersion = "3.12"
@@ -127,12 +157,24 @@ reportMissingTypeStubs = false
127
157
  reportUnnecessaryIsInstance = false
128
158
  reportUnnecessaryTypeIgnoreComment = true
129
159
  reportMissingModuleSource = false
130
- include = ["pydantic_ai_slim", "mcp-run-python", "pydantic_graph", "tests", "examples"]
160
+ include = [
161
+ "pydantic_ai_slim",
162
+ "pydantic_evals",
163
+ "pydantic_graph",
164
+ "mcp-run-python",
165
+ "tests",
166
+ "examples",
167
+ ]
131
168
  venvPath = ".venv"
132
169
  # see https://github.com/microsoft/pyright/issues/7771 - we don't want to error on decorated functions in tests
133
170
  # which are not otherwise used
134
- executionEnvironments = [{ root = "tests", reportUnusedFunction = false }]
135
- exclude = ["examples/pydantic_ai_examples/weather_agent_gradio.py", "mcp-run-python/node_modules"]
171
+ executionEnvironments = [
172
+ { root = "tests", reportUnusedFunction = false, reportPrivateImportUsage = false },
173
+ ]
174
+ exclude = [
175
+ "examples/pydantic_ai_examples/weather_agent_gradio.py",
176
+ "mcp-run-python/node_modules",
177
+ ]
136
178
  extraPaths = ["mcp-run-python/stubs"]
137
179
 
138
180
  [tool.mypy]
@@ -149,7 +191,7 @@ filterwarnings = [
149
191
  "ignore::RuntimeWarning:pydantic_ai.mcp",
150
192
  # uvicorn (mcp server)
151
193
  "ignore:websockets.legacy is deprecated.*:DeprecationWarning:websockets.legacy",
152
- "ignore:websockets.server.WebSocketServerProtocol is deprecated:DeprecationWarning"
194
+ "ignore:websockets.server.WebSocketServerProtocol is deprecated:DeprecationWarning",
153
195
  ]
154
196
 
155
197
  # https://coverage.readthedocs.io/en/latest/config.html#run
@@ -157,6 +199,7 @@ filterwarnings = [
157
199
  # required to avoid warnings about files created by create_module fixture
158
200
  include = [
159
201
  "pydantic_ai_slim/**/*.py",
202
+ "pydantic_evals/**/*.py",
160
203
  "pydantic_graph/**/*.py",
161
204
  "tests/**/*.py",
162
205
  ]
@@ -182,6 +225,7 @@ exclude_lines = [
182
225
  '$\s*assert_never\(',
183
226
  'if __name__ == .__main__.:',
184
227
  'except ImportError as _import_error:',
228
+ '$\s*pass$',
185
229
  ]
186
230
 
187
231
  [tool.logfire]