Skip to content

Commit 6d632ea

Browse files
committed
Feedback
1 parent ac36cae commit 6d632ea

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

pydantic/version.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations as _annotations
44

5-
from importlib.metadata import version
5+
from pydantic_core import __version__ as __pydantic_core_version__
66

77
__all__ = 'VERSION', 'version_info'
88

@@ -67,7 +67,8 @@ def version_info() -> str:
6767

6868
def check_pydantic_core_version() -> bool:
6969
"""Check that the installed `pydantic-core` dependency is compatible."""
70-
return version('pydantic_core') == '2.27.2'
70+
# Keep this in sync with the version constraint in the `pyproject.toml` dependencies:
71+
return __pydantic_core_version__ == '2.27.2'
7172

7273

7374
def parse_mypy_version(version: str) -> tuple[int, int, int]:

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ requires-python = '>=3.9'
4545
dependencies = [
4646
'typing-extensions>=4.12.2',
4747
'annotated-types>=0.6.0',
48+
# Keep this in sync with the version in the `check_pydantic_core_version()` function:
4849
'pydantic-core==2.27.2',
4950
]
5051
dynamic = ['version', 'readme']

0 commit comments

Comments
 (0)