Skip to content

Commit 6c7ac0f

Browse files
committed
Exclude Pydantic 2.12.0 as a workaround for pydantic/pydantic#12347
1 parent 70b8c84 commit 6c7ac0f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ requires-python = ">=3.11"
1616
dependencies = [
1717
"hatchling~=1.18",
1818
"jproperties~=2.1",
19-
"pydantic~=2.3",
19+
# 2.12.0: https://github.com/pydantic/pydantic/issues/12347
20+
"pydantic~=2.3,!=2.12.0",
2021
"casefy~=0.1.7",
2122
"black==23.7.0",
2223
]

src/hatch_gradle_version/common/model.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ def _resolve_paths(cls, value: Any, info: ValidationInfo):
111111
return value
112112
root = Path(root)
113113

114-
assert info.field_name
114+
if info.field_name is None:
115+
raise RuntimeError(
116+
f"Expected field_name to be a string, but got None. This is probably a bug.\n{info=}"
117+
)
118+
115119
field_info = cls.model_fields[info.field_name]
116120

117121
for annotation in field_info.metadata:

0 commit comments

Comments
 (0)