Initial Checks
Description
When a module is imported from pydantic.v1 and a user is running Python 3.14, they'll get a warning: "Core Pydantic V1 functionality isn't compatible with Python 3.14 or greater."
On the surface, the logic here is sound: if the user is importing something from pydantic.v1 they must be about to use that thing, so let's warn them that it's not going to work.
But there are packages that import classes from V1 just to check if the end user is using V1. For example, LangChain in this file.
In these cases, the warning is confusing and sends developers down a rabbit hole of trying to work out "who's trying to use Pydantic V1?" and if they don't know Python intimately, they might think that different packages are using different versions of Pydantic at the same time and they're clashing, all rather unpleasant, considering that nothing's actually wrong!
I see three possible futures:
- Python 3.14 users in this situation get warnings, they can ignore them (warning fatigue, not great)
- All packages that do this "import from
pydantic.v1 to check usage" pattern fix their code to check in some way that doesn't involve importing from pydantic.v1 (probably not going to happen)
- Pydantic refines the logic to only show this warning when it looks like something is actually going to break (e.g. triggered in the constructors of classes)
The current logic is going to be helpful to a shrinking number of users, and rather annoying for a growing number of users.
Relevant PR: #12263
Example Code
Python, Pydantic & OS Version
pydantic version: 2.12.5
pydantic-core version: 2.41.5
pydantic-core build: profile=release pgo=false
python version: 3.14.0 (main, Nov 19 2025, 22:43:52) [MSC v.1944 64 bit (AMD64)]
platform: Windows-11-10.0.26200-SP0
related packages: typing_extensions-4.15.0
commit: unknown
Initial Checks
Description
When a module is imported
from pydantic.v1and a user is running Python 3.14, they'll get a warning: "Core Pydantic V1 functionality isn't compatible with Python 3.14 or greater."On the surface, the logic here is sound: if the user is importing something from
pydantic.v1they must be about to use that thing, so let's warn them that it's not going to work.But there are packages that import classes from V1 just to check if the end user is using V1. For example, LangChain in this file.
In these cases, the warning is confusing and sends developers down a rabbit hole of trying to work out "who's trying to use Pydantic V1?" and if they don't know Python intimately, they might think that different packages are using different versions of Pydantic at the same time and they're clashing, all rather unpleasant, considering that nothing's actually wrong!
I see three possible futures:
pydantic.v1to check usage" pattern fix their code to check in some way that doesn't involve importing frompydantic.v1(probably not going to happen)The current logic is going to be helpful to a shrinking number of users, and rather annoying for a growing number of users.
Relevant PR: #12263
Example Code
Python, Pydantic & OS Version