Skip to content

Commit

Permalink
Add note about pydantic v1 deprecation
Browse files Browse the repository at this point in the history
See discussion on #111 (comment)
  • Loading branch information
cthoyt committed Jul 9, 2024
1 parent 161cf4e commit b8d500a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ This package currently supports both Pydantic v1 and v2. See the
[Pydantic migration guide](https://docs.pydantic.dev/2.0/migration/)
for updating your code.

> [!WARNING]
> Pydantic v1 support will be dropped on October 31<sup>st</sup>, 2024,
> coincident with the [obsolescence of Python 3.8](https://endoflife.date/python).
> This will be accompanied by the v0.8.0 release of the `curies` package.
## 👐 Contributing

Contributions, whether filing an issue, making a pull request, or forking, are appreciated. See
Expand Down
11 changes: 11 additions & 0 deletions src/curies/_pydantic_compat.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""A compatibility layer for pydantic 1 and 2."""

import warnings

from pydantic import __version__ as pydantic_version

__all__ = [
Expand All @@ -12,6 +14,15 @@

if PYDANTIC_V1:
from pydantic import validator as field_validator

warnings.warn(
"The `curies` package will drop Pydantic V1 support on "
"October 31st, 2024, coincident with the obsolescence of Python 3.8 "
"(see https://endoflife.date/python). This will "
"happen with the v0.8.0 release of the `curies` package.",
DeprecationWarning,
stacklevel=1,
)
else:
from pydantic import field_validator

Expand Down

0 comments on commit b8d500a

Please sign in to comment.