Skip to content

Commit 678235e

Browse files
fix: update typer to >=0.12.4 for PEP 604 union type support
PR #349 changed type hints from Optional[bool] to bool | None syntax, but typer < 0.12.4 doesn't support PEP 604 union types (X | None). This caused RuntimeError when running comfy CLI with older typer. Changes: - Update typer dependency from >=0.9 to >=0.12.4 - Remove deprecated is_flag parameter from typer.Option() calls (is_flag was deprecated in typer 0.15.0 and never worked properly) Fixes #355 References: - Typer PEP 604 support: fastapi/typer#548 - is_flag deprecation: fastapi/typer#986 Amp-Thread-ID: https://ampcode.com/threads/T-019bdd23-62ea-732f-9443-5705ebe27a3b Co-authored-by: Amp <[email protected]>
1 parent 88dba42 commit 678235e

File tree

3 files changed

+1
-9
lines changed

3 files changed

+1
-9
lines changed

comfy_cli/cmdline.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ def entry(
7676
bool | None,
7777
typer.Option(
7878
show_default=False,
79-
is_flag=True,
8079
help="Execute from recent path",
8180
callback=g_exclusivity.validate,
8281
),
@@ -85,7 +84,6 @@ def entry(
8584
bool | None,
8685
typer.Option(
8786
show_default=False,
88-
is_flag=True,
8987
help="Execute from current path",
9088
callback=g_exclusivity.validate,
9189
),
@@ -94,7 +92,6 @@ def entry(
9492
bool,
9593
typer.Option(
9694
show_default=False,
97-
is_flag=True,
9895
help="Do not prompt user for input, use default options",
9996
),
10097
] = False,
@@ -103,7 +100,6 @@ def entry(
103100
typer.Option(
104101
show_default=False,
105102
hidden=True,
106-
is_flag=True,
107103
help="Enable tracking",
108104
),
109105
] = False,
@@ -112,7 +108,6 @@ def entry(
112108
"--version",
113109
"-v",
114110
help="Print version and exit",
115-
is_flag=True,
116111
),
117112
):
118113
if version:

comfy_cli/command/custom_nodes/command.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,19 +200,16 @@ def restore_snapshot(
200200
pip_non_url: bool | None = typer.Option(
201201
default=None,
202202
show_default=False,
203-
is_flag=True,
204203
help="Restore for pip packages registered on PyPI.",
205204
),
206205
pip_non_local_url: bool | None = typer.Option(
207206
default=None,
208207
show_default=False,
209-
is_flag=True,
210208
help="Restore for pip packages registered at web URLs.",
211209
),
212210
pip_local_url: bool | None = typer.Option(
213211
default=None,
214212
show_default=False,
215-
is_flag=True,
216213
help="Restore for pip packages specified by local paths.",
217214
),
218215
):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ dependencies = [
4747
"ruff",
4848
"semver~=3.0.2",
4949
"tomlkit",
50-
"typer>=0.9",
50+
"typer>=0.12.4",
5151
"typing-extensions>=4.7",
5252
"uv",
5353
"websocket-client",

0 commit comments

Comments
 (0)