-
Notifications
You must be signed in to change notification settings - Fork 103
/
pyproject.toml
171 lines (152 loc) · 4.61 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "pydantic-ai"
version = "0.0.9"
description = "Agent Framework / shim to use Pydantic with LLMs"
authors = [
{ name = "Samuel Colvin", email = "samuel@pydantic.dev" },
]
license = "MIT"
readme = "README.md"
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: MIT License",
"Operating System :: Unix",
"Operating System :: POSIX :: Linux",
"Environment :: Console",
"Environment :: MacOS X",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Internet",
"Framework :: Pydantic",
"Framework :: Pydantic :: 2",
"Framework :: Pytest",
]
requires-python = ">=3.9"
dependencies = ["pydantic-ai-slim[openai,vertexai,groq]==0.0.9"]
[project.urls]
Homepage = "https://ai.pydantic.dev"
Source = "https://github.com/pydantic/pydantic-ai"
Documentation = "https://ai.pydantic.dev"
Changelog = "https://github.com/pydantic/pydantic-ai/releases"
[project.optional-dependencies]
examples = ["pydantic-ai-examples==0.0.9"]
[tool.uv.sources]
pydantic-ai-slim = { workspace = true }
pydantic-ai-examples = { workspace = true }
[tool.uv.workspace]
members = ["pydantic_ai_slim", "pydantic_ai_examples"]
[dependency-groups]
# dev dependencies are defined in `pydantic-ai-slim/pyproject.toml` to allow for minimal testing
lint = [
"mypy>=1.11.2",
"pyright>=1.1.388",
"ruff>=0.6.9",
]
docs = [
"black>=24.10.0",
"mkdocs>=1.6.1",
"mkdocs-glightbox>=0.4.0",
"mkdocs-material[imaging]>=9.5.45",
"mkdocstrings-python>=1.12.2",
]
[tool.hatch.build.targets.wheel]
only-include = ["/README.md"]
[tool.hatch.build.targets.sdist]
include = ["/README.md", "/Makefile", "/tests"]
[tool.ruff]
line-length = 120
target-version = "py39"
include = [
"pydantic_ai_slim/**/*.py",
"pydantic_ai_examples/**/*.py",
"tests/**/*.py",
"docs/**/*.py",
]
[tool.ruff.lint]
extend-select = [
"Q",
"RUF100",
"C90",
"UP",
"I",
"D",
]
flake8-quotes = { inline-quotes = "single", multiline-quotes = "double" }
isort = { combine-as-imports = true, known-first-party = ["pydantic_ai"] }
mccabe = { max-complexity = 15 }
ignore = [
"D100", # ignore missing docstring in module
"D102", # ignore missing docstring in public method
"D104", # ignore missing docstring in public package
"D105", # ignore missing docstring in magic methods
"D107", # ignore missing docstring in __init__ methods
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.format]
# don't format python in docstrings, pytest-examples takes care of it
docstring-code-format = false
quote-style = "single"
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["D"]
"docs/**/*.py" = ["D"]
"pydantic_ai_examples/**/*.py" = ["D101", "D103"]
[tool.pyright]
typeCheckingMode = "strict"
reportUnnecessaryTypeIgnoreComment = true
reportMissingTypeStubs = false
include = ["pydantic_ai_slim", "tests", "pydantic_ai_examples"]
venvPath = ".venv"
# see https://github.com/microsoft/pyright/issues/7771 - we don't want to error on decorated functions in tests
# which are not otherwise used
executionEnvironments = [
{ root = "tests", reportUnusedFunction = false },
]
[tool.pytest.ini_options]
testpaths = "tests"
xfail_strict = true
filterwarnings = [
"error",
]
# https://coverage.readthedocs.io/en/latest/config.html#run
[tool.coverage.run]
# required to avoid warnings about files created by create_module fixture
include = ["pydantic_ai_slim/**/*.py", "tests/**/*.py"]
omit = ["tests/test_live.py", "tests/example_modules/*.py"]
branch = true
# https://coverage.readthedocs.io/en/latest/config.html#report
[tool.coverage.report]
skip_covered = true
show_missing = true
ignore_errors = true
precision = 2
exclude_lines = [
'def __repr__',
'pragma: no cover',
'raise NotImplementedError',
'if TYPE_CHECKING:',
'if typing.TYPE_CHECKING:',
'@overload',
'@typing.overload',
'\(Protocol\):$',
'typing.assert_never',
'$\s*assert_never\(',
'if __name__ == .__main__.:',
]
[tool.logfire]
ignore_no_config = true
[tool.inline-snapshot.shortcuts]
fix=["create", "fix"]