Skip to content

Commit

Permalink
Lint + edit CI package workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibautLeibel committed Apr 16, 2024
1 parent 5cb97ae commit 5f00486
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_edge_orchestrator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ jobs:
- name: Install dependencies
run: |
make install
pip install setuptools wheel twine -t
pip install setuptools wheel twine -t .
working-directory: ./edge_orchestrator

- name: Build and publish
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import io

from fastapi import APIRouter, BackgroundTasks, Depends, File, UploadFile
from fastapi.responses import JSONResponse

from PIL import Image
import io

from edge_orchestrator.api_config import get_station_config
from edge_orchestrator.domain.models.item import Item
Expand Down
8 changes: 3 additions & 5 deletions edge_orchestrator/edge_orchestrator/domain/models/item.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import datetime as dt
import uuid

from typing import Dict, Type, List

from typing import Dict, List
from uuid import uuid4


def generate_id() -> str:
return str(uuid.uuid4())
return str(uuid4())


class Item:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,5 @@ def get_item_binaries(self, item_id: str, active_config_name: str) -> List[str]:
pass

@abstractmethod
def get_filepath(
self, item_id: str, camera_id: str, active_config_name: str
) -> str:
def get_filepath(self, item_id: str, camera_id: str, active_config_name: str) -> str:
pass
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,5 @@ def get_item_binaries(self, item_id: str) -> List[str]:
binaries.append(f.read())
return binaries

def get_item_binary_filepath(
self, item_id: str, camera_id: str, active_config_name: str
) -> str:
def get_item_binary_filepath(self, item_id: str, camera_id: str, active_config_name: str) -> str:
return f"azure://{self.azure_container_name}/{active_config_name}/{item_id}_{camera_id}.jpg"
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ def get_item_binaries(self, item_id: str, active_config_name: str) -> List[str]:
filepath = self.folder / active_config_name / item_id
return [binary_path.name for binary_path in filepath.glob("*")]

def get_item_binary_filepath(
self, item_id: str, camera_id: str, active_config_name: str
) -> str:
def get_item_binary_filepath(self, item_id: str, camera_id: str, active_config_name: str) -> str:
return str(_get_filepath(self.folder, item_id, camera_id, active_config_name))


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,5 @@ def get_item_binaries(self, item_id: str, active_config_name: str) -> List[str]:
binaries.append(binary)
return binaries

def get_item_binary_filepath(
self, item_id: str, camera_id: str, active_config_name: str
) -> str:
return os.path.join(
self.prefix, active_config_name, item_id, f"{camera_id}.jpg"
)
def get_item_binary_filepath(self, item_id: str, camera_id: str, active_config_name: str) -> str:
return os.path.join(self.prefix, active_config_name, item_id, f"{camera_id}.jpg")
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,5 @@ def get_item_binary(self, item_id: str, camera_id: str, active_config_name: str)
def get_item_binaries(self, item_id: str, active_config_name: str) -> List[str]:
return list(self.binaries[item_id].keys())

def get_filepath(
self, item_id: str, camera_id: str, active_config_name: str
) -> str:
def get_filepath(self, item_id: str, camera_id: str, active_config_name: str) -> str:
return NotImplementedError

0 comments on commit 5f00486

Please sign in to comment.