Skip to content

Commit 2bcec09

Browse files
authored
[Core] Remove add_command_alias (ray-project#58719)
`add_command_alias` deepcopy the `Command` object but it's no longer deep-copyable: pallets/click#3065 (comment). We can remove it completely since it just creates some command aliases that have been deprecated for 5+ years. Closes ray-project#56747 --------- Signed-off-by: Jiajun Yao <jeromeyjj@gmail.com>
1 parent 61905b8 commit 2bcec09

File tree

3 files changed

+5
-22
lines changed

3 files changed

+5
-22
lines changed

python/ray/scripts/scripts.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import copy
21
import json
32
import logging
43
import os
@@ -2770,28 +2769,16 @@ def get_auth_token(generate):
27702769
click.echo(token, nl=False)
27712770

27722771

2773-
def add_command_alias(command, name, hidden):
2774-
new_command = copy.deepcopy(command)
2775-
new_command.hidden = hidden
2776-
cli.add_command(new_command, name=name)
2777-
2778-
27792772
cli.add_command(dashboard)
27802773
cli.add_command(debug)
27812774
cli.add_command(start)
27822775
cli.add_command(stop)
27832776
cli.add_command(up)
2784-
add_command_alias(up, name="create_or_update", hidden=True)
27852777
cli.add_command(attach)
27862778
cli.add_command(exec)
2787-
add_command_alias(exec, name="exec_cmd", hidden=True)
2788-
add_command_alias(rsync_down, name="rsync_down", hidden=True)
2789-
add_command_alias(rsync_up, name="rsync_up", hidden=True)
27902779
cli.add_command(submit)
27912780
cli.add_command(down)
2792-
add_command_alias(down, name="teardown", hidden=True)
27932781
cli.add_command(kill_random_node)
2794-
add_command_alias(get_head_ip, name="get_head_ip", hidden=True)
27952782
cli.add_command(get_worker_ips)
27962783
cli.add_command(microbenchmark)
27972784
cli.add_command(stack)
@@ -2822,16 +2809,16 @@ def add_command_alias(command, name, hidden):
28222809

28232810
cli.add_command(ray_list, name="list")
28242811
cli.add_command(ray_get, name="get")
2825-
add_command_alias(summary_state_cli_group, name="summary", hidden=False)
2826-
add_command_alias(logs_state_cli_group, name="logs", hidden=False)
2812+
cli.add_command(summary_state_cli_group, name="summary")
2813+
cli.add_command(logs_state_cli_group, name="logs")
28272814
except ImportError as e:
28282815
logger.debug(f"Integrating ray state command line tool failed: {e}")
28292816

28302817

28312818
try:
28322819
from ray.dashboard.modules.job.cli import job_cli_group
28332820

2834-
add_command_alias(job_cli_group, name="job", hidden=False)
2821+
cli.add_command(job_cli_group, name="job")
28352822
except Exception as e:
28362823
logger.debug(f"Integrating ray jobs command line tool failed with {e}")
28372824

python/requirements.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
# You can obtain this list from the ray.egg-info/requires.txt
88

99
## setup.py install_requires
10-
# Click 8.3.* does not work with copy.deepcopy on Python 3.10
11-
# TODO(aslonnie): https://github.com/ray-project/ray/issues/56747
12-
click>=7.0, !=8.3.*
10+
click>=7.0
1311
cupy-cuda12x; sys_platform != 'darwin'
1412
filelock
1513
jsonschema

python/setup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,7 @@ def get_packages(self):
402402
# new releases candidates.
403403
if setup_spec.type == SetupType.RAY:
404404
setup_spec.install_requires = [
405-
# Click 8.3.* does not work with copy.deepcopy on Python 3.10
406-
# TODO(aslonnie): https://github.com/ray-project/ray/issues/56747
407-
"click>=7.0, !=8.3.*",
405+
"click>=7.0",
408406
"filelock",
409407
"jsonschema",
410408
"msgpack >= 1.0.0, < 2.0.0",

0 commit comments

Comments
 (0)