Skip to content
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
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[build-system]
requires = [
"setuptools == 82.0.1",
"setuptools_scm[toml] == 10.0.5",
"setuptools_scm[toml] == 10.2.0",
"frequenz-repo-config[lib] == 0.18.0",
]
build-backend = "setuptools.build_meta"
Expand Down Expand Up @@ -55,10 +55,10 @@ email = "floss@frequenz.com"

[project.optional-dependencies]
cli = [
"asyncclick == 8.3.0.7",
"asyncclick == 8.4.2.1",
"prompt-toolkit == 3.0.52",
"parsedatetime == 2.6",
"tzlocal == 5.3.1",
"tzlocal == 5.4.4",
]

dev-flake8 = [
Expand Down Expand Up @@ -99,7 +99,7 @@ dev-pylint = [
"frequenz-api-dispatch == 1.0.0",
]
dev-pytest = [
"pytest == 9.0.3",
"pytest == 9.1.1",
"frequenz-repo-config[extra-lint-examples] == 0.18.0",
"pytest-mock == 3.15.1",
"pytest-asyncio == 1.4.0",
Expand Down
10 changes: 5 additions & 5 deletions src/frequenz/client/dispatch/_cli_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# pylint: disable=inconsistent-return-statements


class FuzzyDateTime(click.ParamType):
class FuzzyDateTime(click.ParamType[datetime | Literal["NOW"] | None]):
"""Try to parse a string as a datetime.

The parser is very permissive and can handle a wide range of time expressions.
Expand Down Expand Up @@ -73,7 +73,7 @@ def convert(
)


class FuzzyTimeDelta(click.ParamType):
class FuzzyTimeDelta(click.ParamType[timedelta]):
"""Try to parse a string as a timedelta.

Uses parsedatetime and tries to parse it as relative datetime first that
Expand Down Expand Up @@ -118,7 +118,7 @@ def convert(
)


class FuzzyIntRange(click.ParamType):
class FuzzyIntRange(click.ParamType[list[int]]):
"""Try to parse a string as a simple integer range.

Possible formats:
Expand Down Expand Up @@ -154,7 +154,7 @@ def convert(
self.fail(f"Invalid integer range: {value}", param, ctx)


class TargetComponentParamType(click.ParamType):
class TargetComponentParamType(click.ParamType[TargetIds | TargetCategories]):
"""Click parameter type for targets."""

name = "target"
Expand Down Expand Up @@ -236,7 +236,7 @@ def enum_from_str(
)


class JsonDictParamType(click.ParamType):
class JsonDictParamType(click.ParamType[dict[str, Any]]):
"""Click parameter type for JSON strings."""

name = "json"
Expand Down
Loading