Skip to content

Commit d42abc7

Browse files
committed
fix: new pydantic version.
1 parent 57801d2 commit d42abc7

File tree

7 files changed

+128
-100
lines changed

7 files changed

+128
-100
lines changed

cmdcomp/config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
from pydantic import RootModel
44

55
from cmdcomp import model
6-
from cmdcomp.v1.config import V1Config
7-
from cmdcomp.v2.config import V2Config
6+
7+
from .v1.config import V1Config
8+
from .v2.config import V2Config
89

910

1011
class Config(RootModel):

cmdcomp/v2/command/base_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def keyword_names_with_alias(self) -> list[Keyword]:
5353

5454
@property
5555
@abstractmethod
56-
def subcommands(self) -> OrderedDict[SubcommandName, "V2Command"]: ...
56+
def subcommands(self) -> "OrderedDict[SubcommandName, V2Command]": ...
5757

5858
@property
5959
@abstractmethod

cmdcomp/v2/command/empty_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class V2EmptyCommand(V2BaseCommand):
1313
@property
1414
@override
15-
def subcommands(self) -> OrderedDict[SubcommandName, "V2Command"]:
15+
def subcommands(self) -> "OrderedDict[SubcommandName, V2Command]":
1616
return OrderedDict()
1717

1818
@property

cmdcomp/v2/command/positional_arguments_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class V2PositionalArgumentsCommand(V2BaseCommand):
3434

3535
@property
3636
@override
37-
def subcommands(self) -> OrderedDict[SubcommandName, "V2Command"]:
37+
def subcommands(self) -> "OrderedDict[SubcommandName, V2Command]":
3838
return OrderedDict()
3939

4040
@property

cmdcomp/v2/command/subcommands_command.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import TYPE_CHECKING, OrderedDict
1+
from typing import TYPE_CHECKING, OrderedDict, Self
22

33
from pydantic import Field
44
from typing_extensions import override
@@ -11,6 +11,8 @@
1111
V2BaseCommand,
1212
convert_argument,
1313
)
14+
from cmdcomp.v2.command.delegate_command import V2DelegateCommand
15+
from cmdcomp.v2.command.positional_arguments_command import V2PositionalArgumentsCommand
1416

1517
from .argument import V2Argument
1618

@@ -25,7 +27,10 @@ class V2SubcommandsCommand(V2BaseCommand):
2527
default_factory=OrderedDict,
2628
)
2729

28-
raw_subcommands: OrderedDict[SubcommandName, "V2Command | None"] = Field(
30+
raw_subcommands: OrderedDict[
31+
SubcommandName,
32+
V2PositionalArgumentsCommand | Self | V2DelegateCommand | None,
33+
] = Field(
2934
title="subcommands of the command.",
3035
alias="subcommands",
3136
default_factory=OrderedDict,
@@ -54,7 +59,7 @@ def keyword_arguments(self) -> OrderedDict[Keyword, V2Argument]:
5459

5560
@property
5661
@override
57-
def subcommands(self) -> OrderedDict[SubcommandName, "V2Command"]:
62+
def subcommands(self) -> "OrderedDict[SubcommandName, V2Command]":
5863
return OrderedDict(
5964
[
6065
(

poetry.lock

Lines changed: 113 additions & 91 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ ci = "task format && task lint && task typecheck && task test"
3333

3434
[tool.poetry.dependencies]
3535
python = "^3.11"
36-
pydantic = "^2.3"
3736
jinja2 = "^3.1.2"
3837
mergedeep = "^1.3.4"
3938
pyyaml = "^6.0"
4039
rich = "^13.4.2"
4140
typing-extensions = "^4.7.1"
4241
rich-argparse = "^1.3.0"
42+
pydantic = "^2.10.6"
4343

4444
[tool.poetry.group.dev.dependencies]
4545
pytest = ">=7.4.1,<9.0.0"

0 commit comments

Comments
 (0)