Skip to content

Commit f5d6790

Browse files
authored
Set minimal supported python to version 3.10 (#349)
1 parent 4a5de50 commit f5d6790

File tree

19 files changed

+133
-218
lines changed

19 files changed

+133
-218
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,3 @@ requirements.compiled
6161
override.txt
6262
.coverage
6363
coverage.xml
64-

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Comfy provides commands that allow you to easily run the installed ComfyUI.
127127

128128
```
129129
comfy launch --frontend-pr "#456"
130-
comfy launch --frontend-pr "username:branch-name"
130+
comfy launch --frontend-pr "username:branch-name"
131131
comfy launch --frontend-pr "https://github.com/Comfy-Org/ComfyUI_frontend/pull/456"
132132
```
133133

@@ -142,7 +142,7 @@ Comfy provides commands that allow you to easily run the installed ComfyUI.
142142
comfy pr-cache clean # Clean all cached builds
143143
comfy pr-cache clean 456 # Clean specific PR cache
144144
```
145-
145+
146146
- Cache automatically expires after 7 days
147147
- Maximum of 10 PR builds are kept (oldest are removed automatically)
148148
- Cache limits help manage disk space while keeping recent builds available

comfy_cli/cmdline.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import subprocess
33
import sys
44
import webbrowser
5-
from typing import Annotated, Optional
5+
from typing import Annotated
66

77
import questionary
88
import typer
@@ -65,15 +65,15 @@ def help(ctx: typer.Context):
6565
def entry(
6666
ctx: typer.Context,
6767
workspace: Annotated[
68-
Optional[str],
68+
str | None,
6969
typer.Option(
7070
show_default=False,
7171
help="Path to ComfyUI workspace",
7272
callback=g_exclusivity.validate,
7373
),
7474
] = None,
7575
recent: Annotated[
76-
Optional[bool],
76+
bool | None,
7777
typer.Option(
7878
show_default=False,
7979
is_flag=True,
@@ -82,7 +82,7 @@ def entry(
8282
),
8383
] = None,
8484
here: Annotated[
85-
Optional[bool],
85+
bool | None,
8686
typer.Option(
8787
show_default=False,
8888
is_flag=True,
@@ -136,7 +136,7 @@ def entry(
136136
# logging.info(f"scan_dir took {end_time - start_time:.2f} seconds to run")
137137

138138

139-
def validate_commit_and_version(commit: Optional[str], ctx: typer.Context) -> Optional[str]:
139+
def validate_commit_and_version(commit: str | None, ctx: typer.Context) -> str | None:
140140
"""
141141
Validate that the commit is not specified unless the version is 'nightly'.
142142
"""
@@ -190,7 +190,7 @@ def install(
190190
bool, typer.Option(show_default=False, help="Skip installing requirements.txt")
191191
] = False,
192192
nvidia: Annotated[
193-
Optional[bool],
193+
bool | None,
194194
typer.Option(
195195
show_default=False,
196196
help="Install for Nvidia gpu",
@@ -199,23 +199,23 @@ def install(
199199
] = None,
200200
cuda_version: Annotated[CUDAVersion, typer.Option(show_default=True)] = CUDAVersion.v12_6,
201201
amd: Annotated[
202-
Optional[bool],
202+
bool | None,
203203
typer.Option(
204204
show_default=False,
205205
help="Install for AMD gpu",
206206
callback=g_gpu_exclusivity.validate,
207207
),
208208
] = None,
209209
m_series: Annotated[
210-
Optional[bool],
210+
bool | None,
211211
typer.Option(
212212
show_default=False,
213213
help="Install for Mac M-Series gpu",
214214
callback=g_gpu_exclusivity.validate,
215215
),
216216
] = None,
217217
intel_arc: Annotated[
218-
Optional[bool],
218+
bool | None,
219219
typer.Option(
220220
hidden=True,
221221
show_default=False,
@@ -224,15 +224,15 @@ def install(
224224
),
225225
] = None,
226226
cpu: Annotated[
227-
Optional[bool],
227+
bool | None,
228228
typer.Option(
229229
show_default=False,
230230
help="Install for CPU",
231231
callback=g_gpu_exclusivity.validate,
232232
),
233233
] = None,
234234
commit: Annotated[
235-
Optional[str], typer.Option(help="Specify commit hash for ComfyUI", callback=validate_commit_and_version)
235+
str | None, typer.Option(help="Specify commit hash for ComfyUI", callback=validate_commit_and_version)
236236
] = None,
237237
fast_deps: Annotated[
238238
bool,
@@ -243,11 +243,11 @@ def install(
243243
),
244244
] = False,
245245
manager_commit: Annotated[
246-
Optional[str],
246+
str | None,
247247
typer.Option(help="Specify commit hash for ComfyUI-Manager"),
248248
] = None,
249249
pr: Annotated[
250-
Optional[str],
250+
str | None,
251251
typer.Option(
252252
show_default=False,
253253
help="Install from a specific PR. Supports formats: username:branch, #123, or PR URL",
@@ -403,15 +403,15 @@ def run(
403403
typer.Option(help="Enables verbose output of the execution process."),
404404
] = False,
405405
host: Annotated[
406-
Optional[str],
406+
str | None,
407407
typer.Option(help="The IP/hostname where the ComfyUI instance is running, e.g. 127.0.0.1 or localhost."),
408408
] = None,
409409
port: Annotated[
410-
Optional[int],
410+
int | None,
411411
typer.Option(help="The port where the ComfyUI instance is running, e.g. 8188."),
412412
] = None,
413413
timeout: Annotated[
414-
Optional[int],
414+
int | None,
415415
typer.Option(help="The timeout in seconds for the workflow execution."),
416416
] = 30,
417417
):
@@ -474,7 +474,7 @@ def launch(
474474
extra: list[str] = typer.Argument(None),
475475
background: Annotated[bool, typer.Option(help="Launch ComfyUI in background")] = False,
476476
frontend_pr: Annotated[
477-
Optional[str],
477+
str | None,
478478
typer.Option(
479479
"--frontend-pr",
480480
show_default=False,
@@ -614,14 +614,14 @@ def standalone(
614614
),
615615
] = False,
616616
platform: Annotated[
617-
Optional[constants.OS],
617+
constants.OS | None,
618618
typer.Option(
619619
show_default=False,
620620
help="Create standalone Python for specified platform",
621621
),
622622
] = None,
623623
proc: Annotated[
624-
Optional[constants.PROC],
624+
constants.PROC | None,
625625
typer.Option(
626626
show_default=False,
627627
help="Create standalone Python for specified processor",

comfy_cli/command/custom_nodes/command.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import sys
66
import uuid
77
from enum import Enum
8-
from typing import Annotated, Optional
8+
from typing import Annotated
99

1010
import typer
1111
from rich import print
@@ -182,7 +182,7 @@ def execute_install_script(repo_path):
182182
@tracking.track_command("node")
183183
def save_snapshot(
184184
output: Annotated[
185-
Optional[str],
185+
str | None,
186186
typer.Option(show_default=False, help="Specify the output file path. (.json/.yaml)"),
187187
] = None,
188188
):
@@ -197,19 +197,19 @@ def save_snapshot(
197197
@tracking.track_command("node")
198198
def restore_snapshot(
199199
path: str,
200-
pip_non_url: Optional[bool] = typer.Option(
200+
pip_non_url: bool | None = typer.Option(
201201
default=None,
202202
show_default=False,
203203
is_flag=True,
204204
help="Restore for pip packages registered on PyPI.",
205205
),
206-
pip_non_local_url: Optional[bool] = typer.Option(
206+
pip_non_local_url: bool | None = typer.Option(
207207
default=None,
208208
show_default=False,
209209
is_flag=True,
210210
help="Restore for pip packages registered at web URLs.",
211211
),
212-
pip_local_url: Optional[bool] = typer.Option(
212+
pip_local_url: bool | None = typer.Option(
213213
default=None,
214214
show_default=False,
215215
is_flag=True,
@@ -307,7 +307,7 @@ def show(
307307
help="Target to display",
308308
),
309309
channel: Annotated[
310-
Optional[str],
310+
str | None,
311311
typer.Option(
312312
show_default=False,
313313
help="Specify the operation mode",
@@ -332,7 +332,7 @@ def simple_show(
332332
help="Target to display",
333333
),
334334
channel: Annotated[
335-
Optional[str],
335+
str | None,
336336
typer.Option(
337337
show_default=False,
338338
help="Specify the operation mode",
@@ -356,7 +356,7 @@ def simple_show(
356356
def install(
357357
nodes: list[str] = typer.Argument(..., help="List of custom nodes to install", autocompletion=node_completer),
358358
channel: Annotated[
359-
Optional[str],
359+
str | None,
360360
typer.Option(
361361
show_default=False,
362362
help="Specify the operation mode",
@@ -421,15 +421,15 @@ def install(
421421
def reinstall(
422422
nodes: list[str] = typer.Argument(..., help="List of custom nodes to reinstall", autocompletion=node_completer),
423423
channel: Annotated[
424-
Optional[str],
424+
str | None,
425425
typer.Option(
426426
show_default=False,
427427
help="Specify the operation mode",
428428
autocompletion=channel_completer,
429429
),
430430
] = None,
431431
fast_deps: Annotated[
432-
Optional[bool],
432+
bool | None,
433433
typer.Option(
434434
"--fast-deps",
435435
show_default=False,
@@ -456,7 +456,7 @@ def reinstall(
456456
def uninstall(
457457
nodes: list[str] = typer.Argument(..., help="List of custom nodes to uninstall", autocompletion=node_completer),
458458
channel: Annotated[
459-
Optional[str],
459+
str | None,
460460
typer.Option(
461461
show_default=False,
462462
help="Specify the operation mode",
@@ -506,7 +506,7 @@ def update(
506506
autocompletion=node_or_all_completer,
507507
),
508508
channel: Annotated[
509-
Optional[str],
509+
str | None,
510510
typer.Option(
511511
show_default=False,
512512
help="Specify the operation mode",
@@ -535,7 +535,7 @@ def disable(
535535
autocompletion=node_or_all_completer,
536536
),
537537
channel: Annotated[
538-
Optional[str],
538+
str | None,
539539
typer.Option(
540540
show_default=False,
541541
help="Specify the operation mode",
@@ -562,7 +562,7 @@ def enable(
562562
autocompletion=node_or_all_completer,
563563
),
564564
channel: Annotated[
565-
Optional[str],
565+
str | None,
566566
typer.Option(
567567
show_default=False,
568568
help="Specify the operation mode",
@@ -589,7 +589,7 @@ def fix(
589589
autocompletion=node_or_all_completer,
590590
),
591591
channel: Annotated[
592-
Optional[str],
592+
str | None,
593593
typer.Option(
594594
show_default=False,
595595
help="Specify the operation mode",
@@ -614,15 +614,15 @@ def fix(
614614
@tracking.track_command("node")
615615
def install_deps(
616616
deps: Annotated[
617-
Optional[str],
617+
str | None,
618618
typer.Option(show_default=False, help="Dependency spec file (.json)"),
619619
] = None,
620620
workflow: Annotated[
621-
Optional[str],
621+
str | None,
622622
typer.Option(show_default=False, help="Workflow file (.json/.png)"),
623623
] = None,
624624
channel: Annotated[
625-
Optional[str],
625+
str | None,
626626
typer.Option(
627627
show_default=False,
628628
help="Specify the operation mode",
@@ -670,7 +670,7 @@ def deps_in_workflow(
670670
workflow: Annotated[str, typer.Option(show_default=False, help="Workflow file (.json/.png)")],
671671
output: Annotated[str, typer.Option(show_default=False, help="Output file (.json)")],
672672
channel: Annotated[
673-
Optional[str],
673+
str | None,
674674
typer.Option(
675675
show_default=False,
676676
help="Specify the operation mode",
@@ -743,7 +743,7 @@ def validate():
743743
@app.command("publish", help="Publish node to registry")
744744
@tracking.track_command("publish")
745745
def publish(
746-
token: Optional[str] = typer.Option(None, "--token", help="Personal Access Token for publishing", hide_input=True),
746+
token: str | None = typer.Option(None, "--token", help="Personal Access Token for publishing", hide_input=True),
747747
):
748748
"""
749749
Publish a node with optional validation.
@@ -843,7 +843,7 @@ def display_all_nodes():
843843
@tracking.track_command("node")
844844
def registry_install(
845845
node_id: str,
846-
version: Optional[str] = None,
846+
version: str | None = None,
847847
force_download: Annotated[
848848
bool,
849849
typer.Option(

0 commit comments

Comments
 (0)