Skip to content

Commit

Permalink
style: Flake8 up
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramimashkouk committed Nov 8, 2024
1 parent 42b8af1 commit be81934
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 25 deletions.
5 changes: 2 additions & 3 deletions backend/chatsky_ui/api/api_v1/endpoints/chatsky_services.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import ast
import re
from io import StringIO
from typing import Dict, Optional, Union
from typing import Dict, Union

import aiofiles
from fastapi import APIRouter, Depends
from fastapi import APIRouter
from pylint.lint import Run, pylinter
from pylint.reporters.text import TextReporter

Expand Down
1 change: 0 additions & 1 deletion backend/chatsky_ui/api/api_v1/endpoints/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from fastapi import APIRouter, status, HTTPException
from omegaconf import OmegaConf
from git import Repo
from git.exc import GitCommandError

from chatsky_ui.core.config import settings
Expand Down
1 change: 0 additions & 1 deletion backend/chatsky_ui/api/deps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from chatsky_ui.core.config import settings
from chatsky_ui.services.process_manager import BuildManager, RunManager
from chatsky_ui.services.websocket_manager import WebSocketManager

Expand Down
5 changes: 2 additions & 3 deletions backend/chatsky_ui/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
import typer
from cookiecutter.main import cookiecutter
from typing_extensions import Annotated
import yaml
from git import Repo

# Patch nest_asyncio before importing Chatsky
nest_asyncio.apply = lambda: None

from chatsky_ui.core.config import app_runner, settings # noqa: E402
from chatsky_ui.core.logger_config import get_logger # noqa: E402
from chatsky_ui.utils.git_cmd import (
from chatsky_ui.utils.git_cmd import ( # noqa: E402
commit_changes,
get_repo,
save_built_script_to_git,
Expand Down Expand Up @@ -165,7 +164,7 @@ def run_scenario(
if not project_dir.is_dir():
raise NotADirectoryError(f"Directory {project_dir} doesn't exist")
settings.set_config(work_directory=project_dir)
script_path = settings.scripts_dir / f"build.yaml"
script_path = settings.scripts_dir / "build.yaml"

command_to_run = f"python {project_dir}/app.py --script-path {script_path}"
try:
Expand Down
2 changes: 1 addition & 1 deletion backend/chatsky_ui/schemas/front_graph_components/slot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional, List
from typing import List

from .base_component import BaseComponent

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from abc import ABC, abstractmethod
import ast

from ..consts import CUSTOM_FILE, CONDITIONS_FILE
from ..base_converter import BaseConverter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import ast

from ..base_converter import BaseConverter
from ....schemas.front_graph_components.info_holders.response import TextResponse, CustomResponse
from ..consts import CUSTOM_FILE, RESPONSES_FILE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from typing import List

from .base_converter import BaseConverter
from ...schemas.front_graph_components.node import InfoNode, LinkNode
from .logic_component_converter.response_converter import TextResponseConverter, CustomResponseConverter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@
from yaml import Loader, Dumper

from ...schemas.front_graph_components.pipeline import Pipeline
from ...schemas.front_graph_components.interface import Interface
from ...schemas.front_graph_components.flow import Flow

from .base_converter import BaseConverter
from .flow_converter import FlowConverter
from .script_converter import ScriptConverter
from .interface_converter import InterfaceConverter
from .slots_converter import SlotsConverter
Expand Down
8 changes: 4 additions & 4 deletions backend/chatsky_ui/tests/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def custom_condition():
"priority": 1,
"transition_type": "manual",
"python": {
"action": """class test_condition(BaseCondition):\n async def call(self, ctx:
Context) -> bool:\n return True"""
"action": """class test_condition(BaseCondition):\n async def call(self, ctx:
Context) -> bool:\n return True"""
},
},
"dst": "dst_test_node",
Expand All @@ -32,8 +32,8 @@ def custom_response():
"data": [
{
"python": {
"action": """class test_response(BaseResponse):\n async def call(self, ctx:
Context) -> Message:\n return Message('Hello')"""
"action": """class test_response(BaseResponse):\n async def call(self, ctx:
Context) -> Message:\n return Message('Hello')"""
}
}
],
Expand Down
4 changes: 2 additions & 2 deletions backend/chatsky_ui/tests/unit/test_logic_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def test_custom_response_converter_fail(self, text_response):

def test_store_custom_service():
current_file_path = Path(__file__).resolve()
service_code = """class test_service(BaseService):\n async def call(self, ctx:
Context) -> Message:\n return Message('Hello')"""
service_code = """class test_service(BaseService):\n async def call(self, ctx:
Context) -> Message:\n return Message('Hello')"""
test_file_path = current_file_path.parent / "store_service_test.py"
test_file_path.touch(exist_ok=True)

Expand Down
2 changes: 0 additions & 2 deletions backend/chatsky_ui/tests/unit/test_node_converer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import pytest

from chatsky_ui.services.json_converter_new2.node_converter import InfoNodeConverter, LinkNodeConverter


Expand Down

0 comments on commit be81934

Please sign in to comment.