File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33from __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
6868def 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
7374def parse_mypy_version (version : str ) -> tuple [int , int , int ]:
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ requires-python = '>=3.9'
4545dependencies = [
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]
5051dynamic = [' version' , ' readme' ]
You can’t perform that action at this time.
0 commit comments