Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Fix Deprecation Warnings #476

Merged
merged 1 commit into from
Jan 2, 2025
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 src/codegate/ca/codegate_ca.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def _load_existing_certificates(self) -> None:
self._cert_cache[common_name] = CachedCertificate(
cert_path=cert_path,
key_path=key_path,
creation_time=datetime.utcnow(),
creation_time=datetime.now(datetime.UTC),
)
else:
logger.debug(f"Skipping expired certificate for {common_name}")
Expand Down
4 changes: 1 addition & 3 deletions src/codegate/pipeline/codegate_context_retriever/codegate.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ async def process(

# Vector search to find bad packages
storage_engine = StorageEngine()
searched_objects = await storage_engine.search(
query=user_messages, distance=0.8, limit=100
)
searched_objects = await storage_engine.search(query=user_messages, distance=0.8, limit=100)

logger.info(
f"Found {len(searched_objects)} matches in the database",
Expand Down
2 changes: 1 addition & 1 deletion src/codegate/utils/package_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class PackageExtractor:
(use_wildcard) @import_name)
(use_declaration
(use_as_clause (scoped_identifier) @import_name))
"""
""",
}

@staticmethod
Expand Down
3 changes: 2 additions & 1 deletion tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock, patch

import httpx
import pytest
from click.testing import CliRunner
from fastapi.middleware.cors import CORSMiddleware
Expand Down Expand Up @@ -143,7 +144,7 @@ def test_system_routes(mock_pipeline_factory) -> None:
async def test_async_health_check(mock_pipeline_factory) -> None:
"""Test the health check endpoint with async client."""
app = init_app(mock_pipeline_factory)
async with AsyncClient(app=app, base_url="http://test") as ac:
async with AsyncClient(transport=httpx.ASGITransport(app=app), base_url="http://test") as ac:
response = await ac.get("/health")
assert response.status_code == 200
assert response.json() == {"status": "healthy"}
Expand Down
Loading