Skip to content

Commit 9e5cc6f

Browse files
authored
Merge pull request #1398 from tisnik/lcore-1476-sorted-imports
LCORE-1476: Sorted imports
2 parents 212958a + ce81f6e commit 9e5cc6f

File tree

100 files changed

+259
-251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+259
-251
lines changed

dev-tools/mcp-mock-server/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
import subprocess
2424
import sys
2525
import threading
26-
from http.server import HTTPServer, BaseHTTPRequestHandler
27-
from datetime import datetime, UTC
26+
from datetime import UTC, datetime
27+
from http.server import BaseHTTPRequestHandler, HTTPServer
2828
from pathlib import Path
2929
from typing import Any
3030

dev-tools/mcp-mock-server/test_mock_mcp_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
import subprocess
1313
import sys
1414
import time
15-
import urllib.request
1615
import urllib.error
16+
import urllib.request
1717
from typing import Any, Optional
1818

1919
import pytest

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ disable = ["R0801"]
226226
extend-exclude = ["tests/profiles/syntax_error.py"]
227227

228228
[tool.ruff.lint]
229-
extend-select = ["TID251", "UP006", "UP007", "UP010", "UP017", "UP035", "RUF100", "B009", "B010", "DTZ005", "D202"]
229+
extend-select = ["TID251", "UP006", "UP007", "UP010", "UP017", "UP035", "RUF100", "B009", "B010", "DTZ005", "D202", "I001"]
230230

231231
[tool.ruff.lint.flake8-tidy-imports.banned-api]
232232
unittest = { msg = "use pytest instead of unittest" }

scripts/gen_doc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
"""Generate documentation for all modules from Lightspeed Core Stack service."""
44

5-
import os
6-
75
import ast
6+
import os
87
from pathlib import Path
98

109
DIRECTORIES = ["src", "tests/unit", "tests/integration", "tests/e2e"]

scripts/generate_openapi_schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88
from fastapi.openapi.utils import get_openapi
99

10+
from client import AsyncLlamaStackClientHolder
11+
1012
# it is needed to read proper configuration in order to start the app to generate schema
1113
from configuration import configuration
1214

13-
from client import AsyncLlamaStackClientHolder
14-
1515
cfg_file = "lightspeed-stack.yaml"
1616
configuration.load_configuration(cfg_file)
1717

tests/benchmarks/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""Fixtures used by benchmarks."""
22

33
from pathlib import Path
4-
import pytest
54

65
import psycopg2
6+
import pytest
77

88
from app import database
9-
from configuration import configuration, AppConfig
9+
from configuration import AppConfig, configuration
1010

1111

1212
@pytest.fixture(name="configuration_filename_sqlite")

tests/benchmarks/db_benchmarks.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
"""Database benchmarks implementations."""
22

3-
from typing import Optional
4-
from sqlalchemy.orm import Session
53
from datetime import UTC, datetime
4+
from typing import Optional
5+
66
from pytest_benchmark.fixture import BenchmarkFixture
7+
from sqlalchemy.orm import Session
78

89
from app.database import get_session
9-
from utils.suid import get_suid
10-
1110
from models.database.conversations import UserConversation
11+
from utils.suid import get_suid
1212

1313
from .data_generators import (
14-
generate_provider,
1514
generate_model_for_provider,
15+
generate_provider,
1616
generate_topic_summary,
1717
)
1818

tests/benchmarks/test_app_database.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
from pytest_benchmark.fixture import BenchmarkFixture
44

55
from .db_benchmarks import (
6-
benchmark_store_new_user_conversations,
7-
benchmark_update_user_conversation,
86
benchmark_list_conversations_for_all_users,
97
benchmark_list_conversations_for_one_user,
108
benchmark_retrieve_conversation,
119
benchmark_retrieve_conversation_for_one_user,
10+
benchmark_store_new_user_conversations,
11+
benchmark_update_user_conversation,
1212
)
1313

1414
# number of records to be stored in database before benchmarks

tests/benchmarks/test_app_database_comparison.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
from pytest_benchmark.fixture import BenchmarkFixture
55

66
from .db_benchmarks import (
7-
benchmark_store_new_user_conversations,
8-
benchmark_update_user_conversation,
97
benchmark_list_conversations_for_all_users,
108
benchmark_list_conversations_for_one_user,
119
benchmark_retrieve_conversation,
1210
benchmark_retrieve_conversation_for_one_user,
11+
benchmark_store_new_user_conversations,
12+
benchmark_update_user_conversation,
1313
)
1414

1515
# number of records to be stored in database before benchmarks

tests/e2e/features/environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414

1515
import requests
1616
from behave.model import Feature, Scenario
17-
from tests.e2e.utils.prow_utils import restore_llama_stack_pod
1817
from behave.runner import Context
1918

2019
from tests.e2e.utils.llama_stack_utils import (
2120
register_shield,
2221
unregister_mcp_toolgroups,
2322
unregister_shield,
2423
)
24+
from tests.e2e.utils.prow_utils import restore_llama_stack_pod
2525
from tests.e2e.utils.utils import (
2626
clear_llama_stack_storage,
2727
create_config_backup,

0 commit comments

Comments
 (0)