Repository: skypilot-org/skypilot (branch: master)
Commit date: 2023-11-08T19:28:09Z

Workflow file: .github/workflows/format.yml (format)
name: format

on:
  # Trigger the workflow on push or pull request,
  # but only for the main branch
  push:
    branches:
      - master
      - 'releases/**'
  pull_request:
    branches:
      - master
      - 'releases/**'
jobs:
  format:
    runs-on: ubuntu-latest
    services:
      pypi_wayback:
        image: ghcr.io/waleko/pypi-wayback
        ports:
          - 8629:8080
    strategy:
      matrix:
        python-version: ["3.8"]
    steps:
    - uses: actions/checkout@v3
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v4
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install yapf==0.32.0
        pip install toml==0.10.2
        pip install black==22.10.0
        pip install isort==5.12.0
    - name: Running yapf
      run: |
        yapf --diff --recursive ./ --exclude 'sky/skylet/ray_patches/**' \
            --exclude 'sky/skylet/providers/aws/**' \
            --exclude 'sky/skylet/providers/gcp/**' \
            --exclude 'sky/skylet/providers/azure/**' \
            --exclude 'sky/skylet/providers/ibm/**'
    - name: Running black
      run: |
        black --diff --check sky/skylet/providers/aws/ \
            sky/skylet/providers/gcp/ \
            sky/skylet/providers/azure/ \
            sky/skylet/providers/ibm/
    - name: Running isort for black formatted files
      run: |
        isort --diff --check --profile black -l 88 -m 3 \
            sky/skylet/providers/ibm/
    - name: Running isort for yapf formatted files
      run: |
        isort --diff --check ./ --sg 'sky/skylet/ray_patches/**' \
            --sg 'sky/skylet/providers/aws/**' \
            --sg 'sky/skylet/providers/gcp/**' \
            --sg 'sky/skylet/providers/azure/**' \
            --sg 'sky/skylet/providers/ibm/**'

env:
  PIP_INDEX_URL: http://localhost:8629/2023-11-08
  UV_INDEX_URL: http://localhost:8629/2023-11-08


Failed build logs:
step_name: format (3.8)/5_Running yapf.txt
log: ##[group]Run yapf --diff --recursive ./ --exclude 'sky/skylet/ray_patches/**' \
[36;1myapf --diff --recursive ./ --exclude 'sky/skylet/ray_patches/**' \[0m
[36;1m    --exclude 'sky/skylet/providers/aws/**' \[0m
[36;1m    --exclude 'sky/skylet/providers/gcp/**' \[0m
[36;1m    --exclude 'sky/skylet/providers/azure/**' \[0m
[36;1m    --exclude 'sky/skylet/providers/ibm/**'[0m
shell: /usr/bin/bash -e {0}
env:
  pythonLocation: /opt/hostedtoolcache/Python/3.8.18/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.8.18/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.8.18/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.8.18/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.8.18/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.8.18/x64/lib
##[endgroup]
--- ./sky/resources.py	(original)
+++ ./sky/resources.py	(reformatted)
@@ -836,8 +836,8 @@
             image_size = self.cloud.get_image_size(image_id, region)
             if image_size >= self.disk_size:
                 with ux_utils.print_exception_no_traceback():
-                    size_comp = ('larger than' if image_size > self.disk_size
-                                 else 'equal to')
+                    size_comp = ('larger than'
+                                 if image_size > self.disk_size else 'equal to')
                     raise ValueError(
                         f'Image {image_id!r} is {image_size}GB, which is '
                         f'{size_comp} the specified disk_size: '
##[error]Process completed with exit code 1.


Changed files:
sky/resources.py

Fix diff:
diff --git a/sky/resources.py b/sky/resources.py
index b965401b..01cb9cce 100644
--- a/sky/resources.py
+++ b/sky/resources.py
@@ -836,8 +836,8 @@ class Resources:
             image_size = self.cloud.get_image_size(image_id, region)
             if image_size >= self.disk_size:
                 with ux_utils.print_exception_no_traceback():
-                    size_comp = ('larger than' if image_size > self.disk_size
-                                 else 'equal to')
+                    size_comp = ('larger than'
+                                 if image_size > self.disk_size else 'equal to')
                     raise ValueError(
                         f'Image {image_id!r} is {image_size}GB, which is '
                         f'{size_comp} the specified disk_size: '