Repository: huggingface/accelerate (branch: device-agnostic-testing)
Commit date: 2023-12-11T06:07:31Z

Workflow file: .github/workflows/quality.yml (Quality Check)
name: Quality Check

on: [pull_request]

jobs:
  quality:
    runs-on: ubuntu-latest
    services:
      pypi_wayback:
        image: ghcr.io/waleko/pypi-wayback
        ports:
          - 8629:8080
    steps:
    - uses: actions/checkout@v3.1.0
    - name: Set up Python 3.8
      uses: actions/setup-python@v3
      with:
        python-version: 3.8
    - name: Install Python dependencies
      run: pip install -e .[quality]
    - name: Run Quality check
      run: make quality
    - name: Check if failure
      if: ${{ failure() }}
      run: |
        echo "Quality check failed. Please ensure the right dependency versions are installed with 'pip install -e .[quality]' and rerun 'make style; make quality;'" >> $GITHUB_STEP_SUMMARY


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


Failed build logs:
step_name: quality/5_Run Quality check.txt
log: ##[group]Run make quality
[36;1mmake quality[0m
shell: /usr/bin/bash -e {0}
env:
  pythonLocation: /opt/hostedtoolcache/Python/3.8.18/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.8.18/x64/lib
##[endgroup]
black --required-version 23 --check tests src examples benchmarks utils
All done! ✨ 🍰 ✨
118 files would be left unchanged.
ruff tests src examples benchmarks utils
tests/deepspeed/test_deepspeed.py:15:1: I001 [*] Import block is un-sorted or un-formatted
tests/fsdp/test_fsdp.py:16:1: I001 [*] Import block is un-sorted or un-formatted
Found 2 errors.
[*] 2 fixable with the `--fix` option.
make: *** [Makefile:16: quality] Error 1
##[error]Process completed with exit code 2.


Changed files:
tests/deepspeed/test_deepspeed.py
tests/fsdp/test_fsdp.py

Fix diff:
diff --git a/tests/deepspeed/test_deepspeed.py b/tests/deepspeed/test_deepspeed.py
index 035965c..612f234 100644
--- a/tests/deepspeed/test_deepspeed.py
+++ b/tests/deepspeed/test_deepspeed.py
@@ -36,9 +36,9 @@ from accelerate.test_utils.testing import (
     AccelerateTestCase,
     TempDirTestCase,
     execute_subprocess_async,
-    require_non_cpu,
     require_deepspeed,
     require_multi_device,
+    require_non_cpu,
     slow,
 )
 from accelerate.test_utils.training import RegressionDataset
diff --git a/tests/fsdp/test_fsdp.py b/tests/fsdp/test_fsdp.py
index d939991..c494f5e 100644
--- a/tests/fsdp/test_fsdp.py
+++ b/tests/fsdp/test_fsdp.py
@@ -28,9 +28,9 @@ from accelerate.test_utils.testing import (
     AccelerateTestCase,
     TempDirTestCase,
     execute_subprocess_async,
-    require_non_cpu,
     require_fsdp,
     require_multi_device,
+    require_non_cpu,
     slow,
 )
 from accelerate.utils.constants import (