-
Notifications
You must be signed in to change notification settings - Fork 253
/
pyproject.toml
164 lines (149 loc) · 4.74 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
[build-system]
requires = [
'maturin>=1,<2',
'typing-extensions >=4.6.0,!=4.7.0'
]
build-backend = 'maturin'
[project]
name = 'pydantic_core'
description = "Core functionality for Pydantic validation and serialization"
requires-python = '>=3.8'
authors = [
{name = 'Samuel Colvin', email = '[email protected]'}
]
classifiers = [
'Development Status :: 3 - Alpha',
'Programming Language :: Python',
'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',
'Programming Language :: Rust',
'Framework :: Pydantic',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Operating System :: Microsoft :: Windows',
'Operating System :: MacOS',
'Typing :: Typed',
]
dependencies = [
'typing-extensions >=4.6.0,!=4.7.0'
]
dynamic = [
'description',
'license',
'readme',
'version'
]
[project.urls]
Homepage = 'https://github.com/pydantic/pydantic-core'
Funding = 'https://github.com/sponsors/samuelcolvin'
Source = 'https://github.com/pydantic/pydantic-core'
[dependency-groups]
testing = [
'backports.zoneinfo; python_version < "3.9"',
'coverage',
'dirty-equals',
'inline-snapshot',
'hypothesis',
# pandas doesn't offer prebuilt wheels for all versions and platforms we test in CI e.g. aarch64 musllinux
'pandas; python_version >= "3.9" and python_version < "3.13" and implementation_name == "cpython" and platform_machine == "x86_64"',
'pytest',
# pytest-examples currently depends on aiohttp via black; we don't want to build it on platforms like aarch64 musllinux in CI
'pytest-examples; implementation_name == "cpython" and platform_machine == "x86_64"',
'pytest-speed',
'pytest-mock',
'pytest-pretty',
'pytest-timeout',
'python-dateutil',
# numpy doesn't offer prebuilt wheels for all versions and platforms we test in CI e.g. aarch64 musllinux
'numpy; python_version >= "3.9" and python_version < "3.13" and implementation_name == "cpython" and platform_machine == "x86_64"',
'exceptiongroup; python_version < "3.11"',
'tzdata',
'typing_extensions',
]
linting = [
'griffe',
'pyright',
'ruff',
'mypy',
]
wasm = [
'typing_extensions',
'maturin>=1,<2',
'ruff',
]
codspeed = [
# codspeed is only run on CI, with latest version of CPython
'pytest-codspeed; python_version == "3.13" and implementation_name == "cpython"',
]
all = [
{ include-group = 'testing' },
{ include-group = 'linting' },
{ include-group = 'wasm' },
]
[tool.maturin]
python-source = "python"
module-name = "pydantic_core._pydantic_core"
bindings = 'pyo3'
features = ["pyo3/extension-module"]
[tool.ruff]
line-length = 120
[tool.ruff.lint]
extend-select = ['Q', 'RUF100', 'C90', 'I']
extend-ignore = [
'E721', # using type() instead of isinstance() - we use this in tests
]
flake8-quotes = {inline-quotes = 'single', multiline-quotes = 'double'}
mccabe = { max-complexity = 13 }
isort = { known-first-party = ['pydantic_core', 'tests'] }
[tool.ruff.format]
quote-style = 'single'
[tool.pytest.ini_options]
testpaths = 'tests'
log_format = '%(name)s %(levelname)s: %(message)s'
filterwarnings = [
'error',
# Python 3.9 and below allowed truncation of float to integers in some
# cases, by not making this an error we can test for this behaviour
'ignore:(.+)Implicit conversion to integers using __int__ is deprecated',
]
timeout = 30
xfail_strict = true
# min, max, mean, stddev, median, iqr, outliers, ops, rounds, iterations
addopts = [
'--benchmark-columns', 'min,mean,stddev,outliers,rounds,iterations',
'--benchmark-group-by', 'group',
'--benchmark-warmup', 'on',
'--benchmark-disable', # this is enable by `make benchmark` when you actually want to run benchmarks
]
[tool.coverage.run]
source = ['pydantic_core']
branch = true
[tool.coverage.report]
precision = 2
exclude_lines = [
'pragma: no cover',
'raise NotImplementedError',
'if TYPE_CHECKING:',
'@overload',
]
# configuring https://github.com/pydantic/hooky
[tool.hooky]
reviewers = ['sydney-runkle', 'davidhewitt']
require_change_file = false
[tool.pyright]
include = ['python/pydantic_core', 'tests/test_typing.py']
reportUnnecessaryTypeIgnoreComment = true
[tool.inline-snapshot.shortcuts]
fix = ["create", "fix"]
[tool.uv]
# this ensures that `uv run` doesn't actually build the package; a `make`
# command is needed to build
package = false