Use pyproject.toml instead of requirements.txt and fix some broken tests.

This commit is contained in:
Hemang
2025-04-17 07:15:28 +02:00
committed by Hemang Sarkar
parent 6b6f33bde6
commit 5bf121bbda
23 changed files with 99 additions and 81 deletions
+2 -3
View File
@@ -8,8 +8,7 @@ from typing import Optional
import fastapi
from httpx import HTTPStatusError
from common.guardrails import Guardrail, GuardrailAction, GuardrailRuleSet
from common.authorization import extract_authorization_from_headers
from gateway.common.guardrails import Guardrail, GuardrailAction, GuardrailRuleSet
def extract_policy_from_headers(request: Optional[fastapi.Request]) -> Optional[str]:
@@ -40,7 +39,7 @@ class GatewayConfig:
Loads the guardrails from the file specified in GUARDRAILS_FILE_PATH.
Returns the guardrails file content as a string.
"""
from integrations.guardrails import _preload
from gateway.integrations.guardrails import _preload
guardrails_file = os.getenv("GUARDRAILS_FILE_PATH", "")
if not guardrails_file:
+3 -3
View File
@@ -5,9 +5,9 @@ from typing import Any, Dict, Optional
import fastapi
from common.config_manager import GatewayConfig
from common.guardrails import GuardrailRuleSet, Guardrail, GuardrailAction
from common.authorization import (
from gateway.common.config_manager import GatewayConfig
from gateway.common.guardrails import GuardrailRuleSet, Guardrail, GuardrailAction
from gateway.common.authorization import (
extract_guardrail_service_authorization_from_headers,
)