fix: resolve circular import in CLI authentication module

- Move ToolCommand import to be local inside _poll_for_token method
- Update test mock to patch ToolCommand at correct location
- Resolves Python 3.11 test collection failure in CI

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2025-06-24 19:08:00 +00:00
parent 842311a52b
commit bc4fd6a39b
2 changed files with 2 additions and 3 deletions

View File

@@ -5,8 +5,6 @@ from typing import Any, Dict
import requests
from rich.console import Console
from crewai.cli.tools.main import ToolCommand
from .constants import AUTH0_AUDIENCE, AUTH0_CLIENT_ID, AUTH0_DOMAIN
from .utils import TokenManager, validate_token
@@ -67,6 +65,7 @@ class AuthenticationCommand:
self.token_manager.save_tokens(token_data["access_token"], expires_in)
try:
from crewai.cli.tools.main import ToolCommand
ToolCommand().login()
except Exception:
console.print(