Skip to content

Commit

Permalink
Add pydantic v2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
titusz committed Jan 21, 2024
1 parent 75a46fd commit 7674bf8
Show file tree
Hide file tree
Showing 6 changed files with 1,007 additions and 895 deletions.
5 changes: 4 additions & 1 deletion iscc_sdk/metadata.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""*Metadata handling functions*"""
from typing import Optional

from pydantic import validator
try:
from pydantic.v1 import validator
except ImportError: # pragma: no cover
from pydantic import validator

import iscc_sdk as idk
import iscc_core as ic
Expand Down
6 changes: 5 additions & 1 deletion iscc_sdk/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
"""
from typing import Optional
from pydantic import Field, validator, BaseSettings

try:
from pydantic.v1 import Field, validator, BaseSettings
except ImportError: # pragma: no cover
from pydantic import Field, validator, BaseSettings
from PIL import Image
import iscc_core

Expand Down
Loading

0 comments on commit 7674bf8

Please sign in to comment.