Skip to content

Commit

Permalink
Pydantic v2 Support?
Browse files Browse the repository at this point in the history
  • Loading branch information
jeeftor committed Dec 11, 2023
1 parent 33c4982 commit 2f931cc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "intellifire4py"
version = "3.3.0"
version = "3.3.1"
description = "Intellifire4Py"
authors = ["Jeff Stein <[email protected]>"]
license = "MIT"
Expand Down
10 changes: 8 additions & 2 deletions src/intellifire4py/model.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
"""Model definitions."""
from __future__ import annotations

from pydantic import Field

try:
from pydantic.v1 import Field
from pydantic.v1 import BaseModel
except ImportError:
from pydantic import Field # type: ignore
from pydantic import BaseModel # type: ignore

from .const import IntelliFireErrorCode, IntelliFireApiMode
from pydantic import BaseModel
from httpx import Cookies


Expand Down
5 changes: 4 additions & 1 deletion tests/test_model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"""Test File."""

from pydantic import ValidationError
try:
from pydantic.v1 import ValidationError
except ImportError:
from pydantic import ValidationError # type: ignore

from intellifire4py.model import IntelliFirePollData

Expand Down

0 comments on commit 2f931cc

Please sign in to comment.