Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ disable = ["R0801"]
extend-exclude = ["tests/profiles/syntax_error.py"]

[tool.ruff.lint]
extend-select = ["TID251", "UP006", "UP007", "RUF100"]
extend-select = ["TID251", "UP006", "UP007", "UP035", "RUF100"]

[tool.ruff.lint.flake8-tidy-imports.banned-api]
unittest = { msg = "use pytest instead of unittest" }
Expand Down
4 changes: 2 additions & 2 deletions src/app/endpoints/a2a.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import asyncio
import json
import uuid
from collections.abc import Mapping
from collections.abc import Mapping, AsyncIterator, MutableMapping
from datetime import datetime, timezone
from typing import Annotated, Any, AsyncIterator, MutableMapping, Optional
from typing import Annotated, Any, Optional

from a2a.server.agent_execution import AgentExecutor, RequestContext
from a2a.server.apps import A2AStarletteApplication
Expand Down
3 changes: 2 additions & 1 deletion src/app/endpoints/streaming_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import asyncio
import datetime
import json
from typing import Annotated, Any, AsyncIterator, Optional, cast
from typing import Annotated, Any, Optional, cast
from collections.abc import AsyncIterator

from fastapi import APIRouter, Depends, HTTPException, Request
from fastapi.responses import StreamingResponse
Expand Down
2 changes: 1 addition & 1 deletion src/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os
from contextlib import asynccontextmanager
from typing import AsyncIterator
from collections.abc import AsyncIterator

from fastapi import FastAPI, HTTPException
from fastapi.middleware.cors import CORSMiddleware
Expand Down
3 changes: 2 additions & 1 deletion src/authentication/jwk_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import json
from asyncio import Lock
from typing import Any, Callable
from typing import Any
from collections.abc import Callable

import aiohttp
from authlib.jose import JsonWebKey, Key, KeySet, jwt
Expand Down
3 changes: 2 additions & 1 deletion src/authorization/middleware.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""Authorization middleware and decorators."""

from functools import lru_cache, wraps
from typing import Any, Callable, Optional
from typing import Any, Optional
from collections.abc import Callable

from fastapi import HTTPException
from starlette.requests import Request
Expand Down
4 changes: 2 additions & 2 deletions src/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from enum import Enum
from functools import cached_property
from pathlib import Path
from typing import Any, Optional, Pattern
from typing import Any, Optional, Literal, Self
from re import Pattern

import jsonpath_ng
import yaml
Expand All @@ -25,7 +26,6 @@
model_validator,
)
from pydantic.dataclasses import dataclass
from typing_extensions import Literal, Self

import constants
from log import get_logger
Expand Down
2 changes: 1 addition & 1 deletion src/models/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from enum import Enum
from typing import Optional, Any
from typing_extensions import Self
from typing import Self

from llama_stack_api.openai_responses import (
OpenAIResponseInputToolChoice as ToolChoice,
Expand Down
3 changes: 2 additions & 1 deletion src/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import asyncio
from functools import wraps
from typing import Any, Callable, cast
from typing import Any, cast
from collections.abc import Callable
from logging import Logger

from llama_stack_client import AsyncLlamaStackClient
Expand Down
3 changes: 2 additions & 1 deletion src/utils/connection_decorator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Decorator that makes sure the object is 'connected' according to it's connected predicate."""

from typing import Any, Callable
from typing import Any
from collections.abc import Callable


def connection(f: Callable) -> Callable:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os
from pathlib import Path
from typing import Generator
from collections.abc import Generator

import pytest
from fastapi import Request, Response
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/endpoints/test_health_integration.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Integration tests for the /health endpoint."""

from typing import Any, Generator
from typing import Any
from collections.abc import Generator

import pytest
from fastapi import Response
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/endpoints/test_info_integration.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Integration tests for the /info endpoint."""

from typing import Generator, Any
from typing import Any
from collections.abc import Generator
import pytest
from pytest_mock import MockerFixture, AsyncMockType

Expand Down
3 changes: 2 additions & 1 deletion tests/integration/endpoints/test_model_list.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Integration tests for the /models endpoint (using Responses API)."""

from typing import Any, Generator
from typing import Any
from collections.abc import Generator

import pytest
from fastapi import Request
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/endpoints/test_query_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
# pylint: disable=too-many-arguments # Integration tests need many fixtures
# pylint: disable=too-many-positional-arguments # Integration tests need many fixtures

from typing import Any, Generator
from typing import Any
from collections.abc import Generator

import pytest
from fastapi import HTTPException, Request, status
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/endpoints/test_root_endpoint.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Integration tests for the /root endpoint."""

from typing import Generator, Any
from typing import Any
from collections.abc import Generator
import pytest
from pytest_mock import MockerFixture

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Integration tests for the /streaming_query endpoint (using Responses API)."""

from collections.abc import AsyncIterator
from typing import Any, Generator
from collections.abc import AsyncIterator, Generator
from typing import Any

import pytest
from fastapi import HTTPException, Request, status
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/endpoints/test_tools_integration.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Integration tests for the /tools endpoint."""

from typing import Any, Generator
from typing import Any
from collections.abc import Generator

import pytest
from fastapi import HTTPException, Request, status
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_rh_identity_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import base64
import json
import os
from typing import Generator
from collections.abc import Generator

import pytest
from fastapi.testclient import TestClient
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/a2a_storage/test_storage_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# pylint: disable=protected-access

from pathlib import Path
from typing import Any, Generator
from typing import Any
from collections.abc import Generator

import pytest
from pytest_mock import MockerFixture
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/app/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# pylint: disable=protected-access

from typing import Generator
from collections.abc import Generator
from pathlib import Path
import tempfile
import pytest
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/app/test_routers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Unit tests for routers.py."""

from typing import Any, Optional, Sequence, Callable
from typing import Any, Optional
from collections.abc import Sequence, Callable

from fastapi import FastAPI

Expand Down
3 changes: 2 additions & 1 deletion tests/unit/authentication/test_jwk_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"""Unit tests for functions defined in authentication/jwk_token.py"""

import time
from typing import Any, Generator, cast
from typing import Any, cast
from collections.abc import Generator

import pytest
from fastapi import HTTPException, Request
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/authorization/test_azure_token_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

import logging
import time
from typing import Any, Generator
from typing import Any
from collections.abc import Generator

import pytest
from azure.core.credentials import AccessToken
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Generator
from collections.abc import Generator

import pytest
from pytest_mock import AsyncMockType, MockerFixture
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/models/rlsapi/test_requests.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# pylint: disable=no-member
"""Unit tests for rlsapi v1 request models."""

from typing import Any, Optional, Callable
from typing import Any, Optional
from collections.abc import Callable

import pytest
from pydantic import BaseModel, ValidationError
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# pylint: disable=too-many-lines

from pathlib import Path
from typing import Any, Generator
from typing import Any
from collections.abc import Generator
from pydantic import ValidationError

import pytest
Expand Down
Loading