Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ format: install $(BIN)/buf $(BIN)/license-header ## Format code
buf format --write .
uv run -- ruff format protovalidate test
uv run -- ruff check --fix protovalidate test
uv run -- tombi format

.PHONY: test
test: generate install $(TESTDATA_FILE) ## Run unit tests
Expand All @@ -78,6 +79,8 @@ lint: install $(BIN)/buf ## Lint code
uv run -- ruff format --check --diff protovalidate test
uv run -- mypy protovalidate
uv run -- ruff check protovalidate test
uv run -- tombi format --check
uv run -- tombi lint
uv lock --check

.PHONY: install
Expand Down
63 changes: 32 additions & 31 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,63 +1,75 @@
[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"
license = "Apache-2.0"
license-files = ["LICENSE"]
keywords = ["protobuf", "protocol buffer", "validate"]
classifiers = [
"Operating System :: OS Independent",
"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'",
"google-re2>=1",
# 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'",
# 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'",
# 1.1 started supporting 3.12.
"google-re2>=1.1; python_version == '3.12'",
"google-re2>=1",
"protobuf>=5",
# 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'",
]
dynamic = ["version"]

[project.urls]
Documentation = "https://protovalidate.com"
Homepage = "https://github.com/bufbuild/protovalidate-python"
Source = "https://github.com/bufbuild/protovalidate-python"
Issues = "https://github.com/bufbuild/protovalidate-python/issues"
Documentation = "https://protovalidate.com"
Source = "https://github.com/bufbuild/protovalidate-python"

[dependency-groups]
dev = [
"google-re2-stubs>=0.1.1",
"mypy>=1.17.1",
"pytest>=9.0.2",
"ruff>=0.12.0",
"tombi>=0.9.12",
"types-protobuf>=5.29.1.20250315",
]

[build-system]
requires = ["hatch-vcs", "hatchling"]
build-backend = "hatchling.build"

[tool.hatch.version]
source = "vcs"
raw-options = { fallback_version = "0.0.0" }

[tool.mypy]
mypy_path = "gen"

[tool.pytest]
# Turn all warnings into errors,
# except DeprecationWarnings (which we knowingly tolerate due to using old `protobuf` APIs).
filterwarnings = ["error", "ignore::DeprecationWarning"]
strict = true
# restrict testpaths to speed up test discovery
testpaths = ["test"]

[tool.ruff]
line-length = 120
lint.select = [
Expand Down Expand Up @@ -107,16 +119,5 @@ ban-relative-imports = "all"
# 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"]
24 changes: 24 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading