Skip to content

Commit

Permalink
Upgrade Pydantic to v2, but still use v1 API (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
istride authored Sep 16, 2024
1 parent 4c89380 commit 93acdec
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies = [
"google-auth-oauthlib~=0.4.4",
"networkx~=2.5.1",
"openpyxl",
"pydantic < 2",
"pydantic >= 2",
"tablib[ods]>=3.1.0",
]

Expand Down
2 changes: 1 addition & 1 deletion src/rpft/parsers/common/model_inference.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from collections import defaultdict
from typing import List, ForwardRef, _eval_type
from pydoc import locate
from pydantic import create_model
from pydantic.v1 import create_model

from rpft.parsers.common.rowparser import (
ParserModel,
Expand Down
2 changes: 1 addition & 1 deletion src/rpft/parsers/common/rowparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from collections.abc import Iterable
from typing import List

from pydantic import BaseModel
from pydantic.v1 import BaseModel


class RowParserError(Exception):
Expand Down
2 changes: 1 addition & 1 deletion src/rpft/parsers/creation/campaigneventrowmodel.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from rpft.parsers.common.rowparser import ParserModel
from pydantic import validator
from pydantic.v1 import validator


class CampaignEventRowModel(ParserModel):
Expand Down
2 changes: 1 addition & 1 deletion src/rpft/parsers/creation/triggerrowmodel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import List

from pydantic import validator
from pydantic.v1 import validator

from rpft.parsers.common.rowparser import ParserModel

Expand Down
2 changes: 1 addition & 1 deletion tests/test_model_inference.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import List
import unittest
from pydantic import create_model, BaseModel
from pydantic.v1 import create_model, BaseModel

from rpft.parsers.common.model_inference import (
get_value_for_type,
Expand Down

0 comments on commit 93acdec

Please sign in to comment.