Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Pydantic to v2, but still use v1 API #142

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading