forked from pydantic/pydantic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
273 lines (252 loc) · 8.51 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
[build-system]
requires = ['hatchling', 'hatch-fancy-pypi-readme>=22.5.0']
build-backend = 'hatchling.build'
[project]
name = 'pydantic'
description = 'Data validation using Python type hints'
authors = [
{name = 'Samuel Colvin', email = 's@muelcolvin.com'},
{name = 'Eric Jolibois', email = 'em.jolibois@gmail.com'},
{name = 'Hasan Ramezani', email = 'hasan.r67@gmail.com'},
{name = 'Adrian Garcia Badaracco', email = '1755071+adriangb@users.noreply.github.com'},
{name = 'Terrence Dorsey', email = 'terry@pydantic.dev'},
{name = 'David Montague', email = 'david@pydantic.dev'},
{name = 'Serge Matveenko', email = 'lig@countzero.co'},
{name = 'Marcelo Trylesinski', email = 'marcelotryle@gmail.com'},
{name = 'Sydney Runkle', email = 'sydneymarierunkle@gmail.com'},
{name = 'David Hewitt', email = 'mail@davidhewitt.io'},
{name = 'Alex Hall', email='alex.mojaki@gmail.com'},
]
license = 'MIT'
classifiers = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.8',
'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',
'Framework :: Hypothesis',
'Framework :: Pydantic',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Internet',
]
requires-python = '>=3.8'
dependencies = [
'typing-extensions>=4.6.1; python_version < "3.13"',
'typing-extensions>=4.12.2; python_version >= "3.13"',
'annotated-types>=0.4.0',
"pydantic-core==2.23.0",
# See: https://docs.python.org/3/library/zoneinfo.html#data-sources
'tzdata; python_version >= "3.9"',
]
dynamic = ['version', 'readme']
[project.optional-dependencies]
email = ['email-validator>=2.0.0']
[project.urls]
Homepage = 'https://github.com/pydantic/pydantic'
Documentation = 'https://docs.pydantic.dev'
Funding = 'https://github.com/sponsors/samuelcolvin'
Source = 'https://github.com/pydantic/pydantic'
Changelog = 'https://docs.pydantic.dev/latest/changelog/'
[tool.hatch.version]
path = 'pydantic/version.py'
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.sdist]
# limit which files are included in the sdist (.tar.gz) asset,
# see https://github.com/pydantic/pydantic/pull/4542
include = [
'/README.md',
'/HISTORY.md',
'/Makefile',
'/pydantic',
'/tests',
'/requirements',
]
[tool.hatch.metadata.hooks.fancy-pypi-readme]
content-type = 'text/markdown'
# construct the PyPI readme from README.md and HISTORY.md
fragments = [
{path = "README.md"},
{text = "\n## Changelog\n\n"},
{path = "HISTORY.md", pattern = "(.+?)<!-- package description limit -->"},
{text = "\n... see [here](https://docs.pydantic.dev/changelog/#v0322-2019-08-17) for earlier changes.\n"},
]
# convert GitHuB issue/PR numbers and handles to links
substitutions = [
{pattern = '(\s+)#(\d+)', replacement = '\1[#\2](https://github.com/pydantic/pydantic/issues/\2)'},
{pattern = '(\s+)@([\w\-]+)', replacement = '\1[@\2](https://github.com/\2)'},
{pattern = '@@', replacement = '@'},
]
[tool.pdm.dev-dependencies]
docs = [
"autoflake",
"mkdocs",
"mkdocs-exclude",
"mkdocs-material",
"mkdocs-redirects",
"mkdocstrings-python",
"tomli",
"pyupgrade",
"mike",
"pytest-examples>=0.0.13",
"pydantic-settings>=2.0b1",
"pydantic-extra-types @ git+https://github.com/pydantic/pydantic-extra-types.git@main",
"requests",
]
linting = [
"eval-type-backport>=0.1.3",
"ruff==0.5.6",
"mypy~=1.1.1",
]
testing = [
"cloudpickle",
"coverage[toml]",
"pytz",
"dirty-equals",
"eval-type-backport",
"pytest>=8.2.2",
"pytest-mock",
"pytest-pretty",
"pytest-examples",
"faker>=18.13.0",
"pytest-benchmark>=4.0.0",
# TODO: remove bound once pytest-codspeed supports 3.13, blocked by `python-cffi`
"pytest-codspeed~=2.2.0; python_version < '3.13'",
"packaging>=23.2",
"jsonschema>=4.23.0",
]
testing-extra = [
# used when generate devtools docs example
"ansi2html",
"devtools",
# used in docs tests
# TODO: remove bound once sqlalchemy supports 3.13
"sqlalchemy>=2.0,<3.0; python_version < '3.13'",
"greenlet>=3.0.0rc3; python_version < '3.13'",
]
mypy = [
"mypy",
"pydantic-settings>=2.0.0",
]
# TODO: remove once memray supports 3.13
memray = ["pytest-memray; python_version < '3.13' and platform_system != 'Windows'"]
[tool.pytest.ini_options]
testpaths = 'tests'
xfail_strict = true
filterwarnings = [
'error',
'ignore:path is deprecated.*:DeprecationWarning:',
# Work around https://github.com/pytest-dev/pytest/issues/10977 for Python 3.12
'ignore:(ast\.Str|ast\.NameConstant|ast\.Num|Attribute s) is deprecated and will be removed.*:DeprecationWarning:',
# pytest-examples needs to remove `co_lnotab` in favor of `co_lines`.
'ignore:co_lnotab is deprecated, use co_lines instead.:DeprecationWarning:',
]
addopts = [
'--benchmark-columns', 'min,mean,stddev,outliers,rounds,iterations',
'--benchmark-group-by', 'group',
'--benchmark-warmup', 'on',
'--benchmark-disable', # this is enabled by `make benchmark` when you actually want to run benchmarks
]
markers = [
'skip_json_schema_validation: Disable JSON Schema validation.',
]
# configuring https://github.com/pydantic/hooky
[tool.hooky]
reviewers = ['sydney-runkle']
require_change_file = false
unconfirmed_label = 'pending'
[tool.ruff]
line-length = 120
target-version = 'py38'
extend-exclude = ['pydantic/v1', 'tests/mypy/']
[tool.ruff.lint]
select = [
'F', # Pyflakes
'E', # pycodestyle (Error)
'I', # isort
'D', # pydocstyle
'UP', # pyupgrade
'YTT', # flake8-2020
'B', # flake8-bugbear
'T10', # flake8-debugger
'T20', # flake8-print
'C4', # flake8-comprehensions
'PYI006', # flake8-pyi
]
ignore = ['D105', 'D107', 'D205', 'D415', 'E501', 'B011', 'B028', 'B904']
flake8-quotes = {inline-quotes = 'single', multiline-quotes = 'double'}
isort = { known-first-party = ['pydantic', 'tests'] }
mccabe = { max-complexity = 14 }
pydocstyle = { convention = 'google' }
[tool.ruff.lint.per-file-ignores]
'docs/*' = ['D']
'pydantic/__init__.py' = ['F405', 'F403', 'D']
'tests/test_forward_ref.py' = ['F821']
'tests/*' = ['D', 'B', 'C4']
'pydantic/deprecated/*' = ['D']
'pydantic/json_schema.py' = ['D']
[tool.ruff.lint.extend-per-file-ignores]
"docs/**/*.py" = ['T']
"tests/**/*.py" = ['T', 'E721', 'F811']
"tests/benchmarks/test_fastapi_startup_generics.py" = ['UP006', 'UP007']
"tests/benchmarks/test_fastapi_startup_simple.py" = ['UP006', 'UP007']
[tool.ruff.format]
quote-style = 'single'
[tool.coverage.run]
source = ['pydantic']
omit = ['pydantic/deprecated/*', 'pydantic/v1/*']
branch = true
relative_files = true
context = '${CONTEXT}'
[tool.coverage.report]
precision = 2
exclude_lines = [
'pragma: no cover',
'raise NotImplementedError',
'if TYPE_CHECKING:',
'if typing.TYPE_CHECKING:',
'@overload',
'@typing.overload',
'\(Protocol\):$',
'typing.assert_never',
'assert_never',
]
[tool.coverage.paths]
source = [
'pydantic/',
'/Users/runner/work/pydantic/pydantic/pydantic/',
'D:\a\pydantic\pydantic\pydantic',
]
[tool.pyright]
include = ['pydantic', 'tests/test_pipeline.py']
exclude = ['pydantic/_hypothesis_plugin.py', 'pydantic/mypy.py', 'pydantic/v1']
# reportUnnecessaryTypeIgnoreComment can't be set since we run pyright with multiple python versions
# reportUnnecessaryTypeIgnoreComment = true
strict = ['tests/test_pipeline.py']
enableExperimentalFeatures = true
[tool.codespell]
skip = '.git,env*,pydantic/v1/*'
# `ser` - abbreviation for "ser"ialisation
# `crate` - a rust crate
ignore-words-list = 'gir,ser,crate'
[tool.codeflash]
module-root = "pydantic"
tests-root = "tests"
test-framework = "pytest"
ignore-paths = []
formatter-cmd = ["ruff check --exit-zero --fix $file", "ruff format $file"]