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

chore: remove pydantic.v1 import #364

Merged
merged 1 commit into from
Jan 31, 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
3 changes: 3 additions & 0 deletions .github/workflows/lib-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:
- name: Install deps
run: poetry install --no-interaction

- name: List pydantic version
run: poetry show pydantic

- name: Run tests with coverage
run: poetry run python -m coverage run -m pytest -n auto

Expand Down
4 changes: 3 additions & 1 deletion src/libecalc/presentation/yaml/yaml_types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@


class YamlBase(BaseModel, ABC):
model_config = ConfigDict(populate_by_name=True, alias_generator=str.upper, extra="forbid")
model_config = ConfigDict(
populate_by_name=True, alias_generator=lambda field_name: field_name.upper(), extra="forbid"
)
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
from typing import List

try:
from pydantic.v1 import Field
except ImportError:
from pydantic import Field
from pydantic import Field

from libecalc.expression.expression import ExpressionType
from libecalc.presentation.yaml.yaml_types import YamlBase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
from typing import Literal

try:
from pydantic.v1 import Field
except ImportError:
from pydantic import Field
from pydantic import Field

from libecalc.expression.expression import ExpressionType
from libecalc.presentation.yaml.yaml_types.components.legacy.energy_usage_model.common import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
from typing import List, Literal

try:
from pydantic.v1 import Field
except ImportError:
from pydantic import Field
from pydantic import Field

from libecalc.expression.expression import ExpressionType
from libecalc.presentation.yaml.yaml_types import YamlBase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
from typing import List, Literal

try:
from pydantic.v1 import Field
except ImportError:
from pydantic import Field
from pydantic import Field

from libecalc.expression.expression import ExpressionType
from libecalc.presentation.yaml.yaml_types.components.legacy.energy_usage_model.common import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import enum
from typing import Literal

try:
from pydantic.v1 import Field
except ImportError:
from pydantic import Field
from pydantic import Field

from libecalc.expression.expression import ExpressionType
from libecalc.presentation.yaml.yaml_types.components.legacy.energy_usage_model.common import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
from typing import Literal

try:
from pydantic.v1 import Field
except ImportError:
from pydantic import Field
from pydantic import Field

from libecalc.expression.expression import ExpressionType
from libecalc.presentation.yaml.yaml_types.components.legacy.energy_usage_model.common import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
from typing import List, Literal

try:
from pydantic.v1 import Field
except ImportError:
from pydantic import Field
from pydantic import Field

from libecalc.expression.expression import ExpressionType
from libecalc.presentation.yaml.yaml_types import YamlBase
Expand Down

Large diffs are not rendered by default.

Loading