Repository: lightly-ai/lightly (branch: v4)
Commit date: 2024-01-22T10:34:15Z

Workflow file: .github/workflows/test_code_format.yml (Code Format Check)
name: Code Format Check

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  test:
    name: Check
    runs-on: ubuntu-latest
    services:
      pypi_wayback:
        image: ghcr.io/waleko/pypi-wayback
        ports:
          - 8629:8080
    steps:
    - name: Checkout Code
      uses: actions/checkout@v3
    - name: Hack to get setup-python to work on nektos/act
      run: |
        if [ ! -f "/etc/lsb-release" ] ; then
          echo "DISTRIB_RELEASE=18.04" > /etc/lsb-release
        fi
    - name: Set up Python
      uses: actions/setup-python@v4
      with:
        python-version: "3.7"
    - uses: actions/cache@v2
      with:
        path: ${{ env.pythonLocation }}
        key: cache_v2_${{ env.pythonLocation }}-${{ hashFiles('requirements/**') }}
    - name: Install Dependencies and lightly
      run: pip install -e '.[all]'
    - name: Run Format Check
      run: |
        make format-check
    - name: Run Type Check
      run: |
        make type-check

env:
  PIP_INDEX_URL: http://localhost:8629/2024-01-22
  UV_INDEX_URL: http://localhost:8629/2024-01-22


Failed build logs:
step_name: Check/7_Run Format Check.txt
log: ##[group]Run make format-check
[36;1mmake format-check[0m
shell: /usr/bin/bash -e {0}
env:
  pythonLocation: /opt/hostedtoolcache/Python/3.7.17/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.7.17/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.7.17/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.7.17/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.7.17/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.7.17/x64/lib
##[endgroup]
⚫ Checking code format...
isort --check-only --diff .
ERROR: /home/runner/work/lightly/lightly/lightly/api/api_workflow_compute_worker.py Imports are incorrectly sorted and/or formatted.
--- /home/runner/work/lightly/lightly/lightly/api/api_workflow_compute_worker.py:before	2024-01-22 10:34:39.616318
+++ /home/runner/work/lightly/lightly/lightly/api/api_workflow_compute_worker.py:after	2024-01-22 10:35:58.211024
@@ -16,8 +16,8 @@
     DockerRunScheduledPriority,
     DockerRunScheduledState,
     DockerRunState,
+    DockerWorkerConfigOmniVXCreateRequest,
     DockerWorkerConfigV3,
-    DockerWorkerConfigOmniVXCreateRequest,
     DockerWorkerConfigV3Docker,
     DockerWorkerConfigV3Lightly,
     DockerWorkerRegistryEntryData,
Skipped 2 files
make: *** [Makefile:45: format-check] Error 1
##[error]Process completed with exit code 2.


Changed files:
lightly/api/api_workflow_compute_worker.py

Fix diff:
diff --git a/lightly/api/api_workflow_compute_worker.py b/lightly/api/api_workflow_compute_worker.py
index 9ff99986..8b944c53 100644
--- a/lightly/api/api_workflow_compute_worker.py
+++ b/lightly/api/api_workflow_compute_worker.py
@@ -16,8 +16,8 @@ from lightly.openapi_generated.swagger_client.models import (
     DockerRunScheduledPriority,
     DockerRunScheduledState,
     DockerRunState,
-    DockerWorkerConfigV3,
     DockerWorkerConfigOmniVXCreateRequest,
+    DockerWorkerConfigV3,
     DockerWorkerConfigV3Docker,
     DockerWorkerConfigV3Lightly,
     DockerWorkerRegistryEntryData,
@@ -243,11 +243,13 @@ class _ComputeWorkerMixin:
             lightly=lightly,
             selection=selection,
         )
-        request = DockerWorkerConfigOmniVXCreateRequest.from_dict({
-            "version": "V3",
-            "config": config.to_dict(by_alias=True),
-            "creator": self._creator,
-        })
+        request = DockerWorkerConfigOmniVXCreateRequest.from_dict(
+            {
+                "version": "V3",
+                "config": config.to_dict(by_alias=True),
+                "creator": self._creator,
+            }
+        )
         try:
             response = self._compute_worker_api.create_docker_worker_config_vx(request)
             return response.id