-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathpyproject.toml
More file actions
121 lines (110 loc) · 2.88 KB
/
pyproject.toml
File metadata and controls
121 lines (110 loc) · 2.88 KB
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
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "protovalidate"
description = "Protocol Buffer Validation for Python"
readme = "README.md"
license = "Apache-2.0"
license-files = ["LICENSE"]
keywords = ["validate", "protobuf", "protocol buffer"]
# Keep our minimum version synced with ./.python-version.
requires-python = ">=3.10"
classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Operating System :: OS Independent",
"Typing :: Typed",
]
dynamic = ["version"]
dependencies = [
# We need at least this version, which fixed Python 3.14 compatibility (tp_new metaclass issue).
# The fix was never backported to the 5.x series.
# Ref: https://github.com/protocolbuffers/protobuf/pull/20594
"protobuf>=6.31.0; python_version >= '3.14'",
"protobuf>=5",
"cel-python>=0.5",
# We need at least this version, which started publishing wheels for Python 3.14.
# Ref: https://github.com/google/re2/issues/580
"google-re2>=1.1.20251105; python_version == '3.14'",
# We need at least this version, which started publishing wheels for Python 3.13.
# Ref: https://github.com/google/re2/issues/516
"google-re2>=1.1.20250722; python_version == '3.13'",
# 1.1 started supporting 3.12.
"google-re2>=1.1; python_version == '3.12'",
"google-re2>=1",
]
[project.urls]
Homepage = "https://github.com/bufbuild/protovalidate-python"
Source = "https://github.com/bufbuild/protovalidate-python"
Issues = "https://github.com/bufbuild/protovalidate-python/issues"
[dependency-groups]
dev = [
"google-re2-stubs>=0.1.1",
"mypy>=1.17.1",
"pytest>=9.0.2",
"ruff>=0.12.0",
"types-protobuf>=5.29.1.20250315",
]
[tool.hatch.version]
source = "vcs"
raw-options = { fallback_version = "0.0.0" }
[tool.ruff]
line-length = 120
lint.select = [
"A",
"ARG",
"B",
"C",
"DTZ",
"E",
"EM",
"F",
"FBT",
"I",
"ICN",
"N",
"PLC",
"PLE",
"PLR",
"PLW",
"Q",
"RUF",
"S",
"T",
"TID",
"UP",
"W",
"YTT",
]
lint.ignore = [
# Ignore complexity
"C901",
"PLR0911",
"PLR0912",
"PLR0913",
"PLR0915",
# Ignore magic values - in this library, most are obvious in context.
"PLR2004",
]
[tool.ruff.lint.isort]
known-first-party = ["protovalidate", "buf"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.per-file-ignores]
# Tests can use assertions.
"test/**/*" = ["S101"]
[tool.pytest]
strict = true
# restrict testpaths to speed up test discovery
testpaths = ["test"]
# Turn all warnings into errors,
# except DeprecationWarnings (which we knowingly tolerate due to using old `protobuf` APIs).
filterwarnings = ["error", "ignore::DeprecationWarning"]
[tool.mypy]
mypy_path = "gen"
[tool.ty.environment]
extra-paths = ["gen"]