Repository: huggingface/diffusers (branch: ipadapterfaceid)
Commit date: 2023-12-26T09:43:43Z

Workflow file: .github/workflows/pr_quality.yml (Run code quality checks)
name: Run code quality checks

on:
  pull_request:
    branches:
      - main
  push:
    branches:
      - main

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

jobs:
  check_code_quality:
    runs-on: ubuntu-latest
    services:
      pypi_wayback:
        image: ghcr.io/waleko/pypi-wayback
        ports:
          - 8629:8080
    steps:
      - uses: actions/checkout@v3
      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: "3.8"
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install .[quality]
      - name: Check quality
        run: |
          ruff check examples tests src utils scripts
          ruff format examples tests src utils scripts --check

  check_repository_consistency:
    runs-on: ubuntu-latest
    services:
      pypi_wayback:
        image: ghcr.io/waleko/pypi-wayback
        ports:
          - 8629:8080
    steps:
      - uses: actions/checkout@v3
      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: "3.8"
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install .[quality]
      - name: Check quality
        run: |
          python utils/check_copies.py
          python utils/check_dummies.py
          make deps_table_check_updated

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


Failed build logs:
step_name: check_code_quality/5_Check quality.txt
log: ##[group]Run ruff check examples tests src utils scripts
[36;1mruff check examples tests src utils scripts[0m
[36;1mruff format examples tests src utils scripts --check[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]
src/diffusers/loaders/ip_adapter.py:15:26: F401 [*] `typing.Optional` imported but unused
Found 1 error.
[*] 1 fixable with the `--fix` option.
##[error]Process completed with exit code 1.


Changed files:
src/diffusers/loaders/ip_adapter.py

Fix diff:
diff --git a/src/diffusers/loaders/ip_adapter.py b/src/diffusers/loaders/ip_adapter.py
index df9caa946..0c310019f 100644
--- a/src/diffusers/loaders/ip_adapter.py
+++ b/src/diffusers/loaders/ip_adapter.py
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 import os
-from typing import Dict, Optional, Union
+from typing import Dict, Union
 
 import torch
 from huggingface_hub.utils import validate_hf_hub_args