mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 23:58:34 +00:00
Fix lint and type-checker issues in OAuth2 implementation
- Remove unused imports (List, Optional, MagicMock) - Fix type annotation: change 'any' to 'Any' in oauth2_token_manager.py - All OAuth2 tests still pass after fixes Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from pathlib import Path
|
||||
from typing import Dict, List, Optional
|
||||
from typing import Dict, Optional
|
||||
import json
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import time
|
||||
import requests
|
||||
from typing import Dict, Optional
|
||||
from typing import Dict, Any
|
||||
from .oauth2_config import OAuth2Config
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class OAuth2TokenManager:
|
||||
|
||||
return self._acquire_new_token(config)
|
||||
|
||||
def _is_token_valid(self, token_data: Dict[str, any]) -> bool:
|
||||
def _is_token_valid(self, token_data: Dict[str, Any]) -> bool:
|
||||
"""Check if token is still valid (not expired)"""
|
||||
if "expires_at" not in token_data:
|
||||
return False
|
||||
|
||||
@@ -4,7 +4,7 @@ import requests
|
||||
import tempfile
|
||||
import time
|
||||
from pathlib import Path
|
||||
from unittest.mock import Mock, patch, MagicMock
|
||||
from unittest.mock import Mock, patch
|
||||
from crewai.llm import LLM
|
||||
from crewai.llms.oauth2_config import OAuth2Config, OAuth2ConfigLoader
|
||||
from crewai.llms.oauth2_token_manager import OAuth2TokenManager
|
||||
|
||||
Reference in New Issue
Block a user