Skip to content

Commit 70b1f41

Browse files
committed
chore: deprecate pylint-quotes so that we can upgrade pylint
1 parent 860c4ae commit 70b1f41

File tree

10 files changed

+29
-31
lines changed

10 files changed

+29
-31
lines changed

.github/workflows/pylint.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ jobs:
3030
python -m pip install --upgrade pip
3131
pip install ".[all]"
3232
pip install pylint==$(grep 'pylint==' requirements-dev.txt | cut -d'=' -f3)
33-
pip install pylint-quotes==$(grep 'pylint-quotes==' requirements-dev.txt | cut -d'=' -f3)
3433
- name: Analysing the code with pylint
3534
run: |
36-
pylint --load-plugins pylint_quotes sky
35+
pylint sky

.pylintrc

+3-10
Original file line numberDiff line numberDiff line change
@@ -429,13 +429,6 @@ valid-metaclass-classmethod-first-arg=mcs
429429

430430
# Exceptions that will emit a warning when being caught. Defaults to
431431
# "Exception"
432-
overgeneral-exceptions=StandardError,
433-
Exception,
434-
BaseException
435-
436-
#######
437-
438-
# https://github.com/edaniszewski/pylint-quotes#configuration
439-
string-quote=single
440-
triple-quote=double
441-
docstring-quote=double
432+
overgeneral-exceptions=builtins.StandardError,
433+
builtins.Exception,
434+
builtins.BaseException

format.sh

-6
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ builtin cd "$ROOT" || exit 1
2323

2424
YAPF_VERSION=$(yapf --version | awk '{print $2}')
2525
PYLINT_VERSION=$(pylint --version | head -n 1 | awk '{print $2}')
26-
PYLINT_QUOTES_VERSION=$(pip list | grep pylint-quotes | awk '{print $2}')
2726
MYPY_VERSION=$(mypy --version | awk '{print $2}')
2827
BLACK_VERSION=$(black --version | head -n 1 | awk '{print $2}')
2928

@@ -37,7 +36,6 @@ tool_version_check() {
3736

3837
tool_version_check "yapf" $YAPF_VERSION "$(grep yapf requirements-dev.txt | cut -d'=' -f3)"
3938
tool_version_check "pylint" $PYLINT_VERSION "$(grep "pylint==" requirements-dev.txt | cut -d'=' -f3)"
40-
tool_version_check "pylint-quotes" $PYLINT_QUOTES_VERSION "$(grep "pylint-quotes==" requirements-dev.txt | cut -d'=' -f3)"
4139
tool_version_check "mypy" "$MYPY_VERSION" "$(grep mypy requirements-dev.txt | cut -d'=' -f3)"
4240
tool_version_check "black" "$BLACK_VERSION" "$(grep black requirements-dev.txt | cut -d'=' -f3)"
4341

@@ -60,10 +58,6 @@ BLACK_INCLUDES=(
6058
'sky/skylet/providers/ibm'
6159
)
6260

63-
PYLINT_FLAGS=(
64-
'--load-plugins' 'pylint_quotes'
65-
)
66-
6761
# Format specified files
6862
format() {
6963
yapf --in-place "${YAPF_FLAGS[@]}" "$@"

requirements-dev.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# formatting
22
yapf==0.32.0
3-
pylint==2.14.5
3+
pylint==3.2.7
44
# formatting the node_providers code from upstream ray-project/ray project
55
black==22.10.0
6-
# https://github.com/edaniszewski/pylint-quotes
7-
pylint-quotes==0.2.3
86
toml==0.10.2
97
isort==5.12.0
108

sky/backends/cloud_vm_ray_backend.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -2475,10 +2475,12 @@ def num_ips_per_node(self) -> int:
24752475
num_ips = 1
24762476
return num_ips
24772477

2478-
def __setstate__(self, state):
2478+
def __setstate__(self, state: Dict[str, Any]):
24792479
self._version = self._VERSION
24802480

24812481
version = state.pop('_version', None)
2482+
head_ip: Optional[str] = None
2483+
24822484
if version is None:
24832485
version = -1
24842486
state.pop('cluster_region', None)
@@ -2502,7 +2504,6 @@ def __setstate__(self, state):
25022504
if version < 9:
25032505
# For backward compatibility, we should update the region of a
25042506
# SkyPilot cluster on Kubernetes to the actual context it is using.
2505-
# pylint: disable=import-outside-toplevel
25062507
launched_resources = state['launched_resources']
25072508
if isinstance(launched_resources.cloud, clouds.Kubernetes):
25082509
yaml_config = common_utils.read_yaml(
@@ -3272,7 +3273,7 @@ def _exec_code_on_head(
32723273
mkdir_code = (f'{cd} && mkdir -p {remote_log_dir} && '
32733274
f'touch {remote_log_path}')
32743275
encoded_script = shlex.quote(codegen)
3275-
create_script_code = (f'{{ echo {encoded_script} > {script_path}; }}')
3276+
create_script_code = f'{{ echo {encoded_script} > {script_path}; }}'
32763277
job_submit_cmd = (
32773278
f'RAY_DASHBOARD_PORT=$({constants.SKY_PYTHON_CMD} -c "from sky.skylet import job_lib; print(job_lib.get_job_submission_port())" 2> /dev/null || echo 8265);' # pylint: disable=line-too-long
32783279
f'{cd} && {constants.SKY_RAY_CMD} job submit '
@@ -3829,6 +3830,7 @@ def teardown_no_lock(self,
38293830
RuntimeError: If the cluster fails to be terminated/stopped.
38303831
"""
38313832
cluster_status_fetched = False
3833+
prev_cluster_status = None
38323834
if refresh_cluster_status:
38333835
try:
38343836
prev_cluster_status, _ = (

sky/cli.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def _merge_env_vars(env_dict: Optional[Dict[str, str]],
210210
default=None,
211211
type=int,
212212
required=False,
213-
help=('OS disk size in GBs.')),
213+
help='OS disk size in GBs.'),
214214
click.option('--disk-tier',
215215
default=None,
216216
type=click.Choice(resources_utils.DiskTier.supported_tiers(),
@@ -392,7 +392,8 @@ def _install_shell_completion(ctx: click.Context, param: click.Parameter,
392392
else:
393393
click.secho(f'Unsupported shell: {value}', fg='red')
394394
ctx.exit()
395-
395+
# Though `ctx.exit()` already NoReturn, we need to make pylint happy.
396+
assert False, 'Unreachable'
396397
try:
397398
subprocess.run(cmd,
398399
shell=True,
@@ -447,6 +448,8 @@ def _uninstall_shell_completion(ctx: click.Context, param: click.Parameter,
447448
else:
448449
click.secho(f'Unsupported shell: {value}', fg='red')
449450
ctx.exit()
451+
# Though `ctx.exit()` already NoReturn, we need to make pylint happy.
452+
assert False, 'Unreachable'
450453

451454
try:
452455
subprocess.run(cmd, shell=True, check=True)
@@ -3530,7 +3533,7 @@ def jobs():
35303533
default=None,
35313534
type=str,
35323535
hidden=True,
3533-
help=('Alias for --name, the name of the managed job.'))
3536+
help='Alias for --name, the name of the managed job.')
35343537
@click.option('--job-recovery',
35353538
default=None,
35363539
type=str,
@@ -4544,7 +4547,7 @@ def serve_logs(
45444547
sky serve logs [SERVICE_NAME] 1
45454548
"""
45464549
have_replica_id = replica_id is not None
4547-
num_flags = (controller + load_balancer + have_replica_id)
4550+
num_flags = controller + load_balancer + have_replica_id
45484551
if num_flags > 1:
45494552
raise click.UsageError('At most one of --controller, --load-balancer, '
45504553
'[REPLICA_ID] can be specified.')

sky/optimizer.py

+1
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ def _optimize_by_dp(
435435
# FIXME: Account for egress costs for multi-node clusters
436436
for resources, execution_cost in node_to_cost_map[node].items():
437437
min_pred_cost_plus_egress = np.inf
438+
best_parent_hardware = resources_lib.Resources()
438439
for parent_resources, parent_cost in \
439440
dp_best_objective[parent].items():
440441
egress_cost = Optimizer._egress_cost_or_time(

sky/serve/constants.py

+4
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,7 @@
100100
TERMINATE_REPLICA_VERSION_MISMATCH_ERROR = (
101101
'The version of service is outdated and does not support manually '
102102
'terminating replicas. Please terminate the service and spin up again.')
103+
104+
# Default timeout in seconds for HTTP requests to avoid hanging indefinitely.
105+
# This is used for internal service communication requests.
106+
DEFAULT_HTTP_REQUEST_TIMEOUT_SECONDS = 30

sky/serve/replica_managers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ def probe(
528528
logger.info(f'Error when probing {replica_identity}: '
529529
'Cannot get the endpoint.')
530530
return self, False, probe_time
531-
readiness_path = (f'{url}{readiness_path}')
531+
readiness_path = f'{url}{readiness_path}'
532532
logger.info(f'Probing {replica_identity} with {readiness_path}.')
533533
if post_data is not None:
534534
msg += 'POST'

sky/serve/serve_utils.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,9 @@ def update_service_encoded(service_name: str, version: int, mode: str) -> str:
300300
json={
301301
'version': version,
302302
'mode': mode,
303-
})
303+
},
304+
timeout=constants.DEFAULT_HTTP_REQUEST_TIMEOUT_SECONDS,
305+
)
304306
if resp.status_code == 404:
305307
with ux_utils.print_exception_no_traceback():
306308
raise ValueError(
@@ -342,7 +344,9 @@ def terminate_replica(service_name: str, replica_id: int, purge: bool) -> str:
342344
json={
343345
'replica_id': replica_id,
344346
'purge': purge,
345-
})
347+
},
348+
timeout=constants.DEFAULT_HTTP_REQUEST_TIMEOUT_SECONDS,
349+
)
346350

347351
message: str = resp.json()['message']
348352
if resp.status_code != 200:

0 commit comments

Comments
 (0)