diff --git a/.github/workflows/deepeval-results.yml b/.github/workflows/deepeval-results.yml index 865cff5b7..5f77643af 100644 --- a/.github/workflows/deepeval-results.yml +++ b/.github/workflows/deepeval-results.yml @@ -26,17 +26,23 @@ jobs: virtualenvs-create: true virtualenvs-in-project: true - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v3 - with: - path: .venv - key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + # - name: Load cached venv + # id: cached-poetry-dependencies + # uses: actions/cache@v3 + # with: + # path: .venv + # key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} - name: Install dependencies if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: poetry install --no-interaction + - name: List Installed Packages + run: poetry run pip list + + - name: Check if 'deepeval' script is available + run: ls -l $(poetry env info --path)/bin/deepeval || echo "deepeval script not found" + - name: Run deepeval tests and capture output run: poetry run deepeval test run tests/test_quickstart.py > output.txt 2>&1 diff --git a/deepeval/_version.py b/deepeval/_version.py index e9913d66a..c48754365 100644 --- a/deepeval/_version.py +++ b/deepeval/_version.py @@ -1 +1 @@ -__version__: str = "0.20.29" +__version__: str = "0.20.30" diff --git a/deepeval/cli/main.py b/deepeval/cli/main.py index f50ba676c..88d1bc7ab 100644 --- a/deepeval/cli/main.py +++ b/deepeval/cli/main.py @@ -9,6 +9,7 @@ from deepeval.api import Api from deepeval.key_handler import KEY_FILE_HANDLER from deepeval.cli.test import app as test_app +from typing import Optional import webbrowser app = typer.Typer(name="deepeval") @@ -23,21 +24,32 @@ def login( typer.Option( help="API key to get from https://app.confident-ai.com. Required if you want to log events to the server." ), - ] = "" + ] = "", + confident_api_key: Optional[str] = typer.Option( + None, + "--confident-api-key", + "-c", + help="Optional confident API key to bypass login.", + ), ): - """Login to the DeepEval platform.""" - print("Welcome to [bold]DeepEval[/bold]!") - print( - "Grab your API key here: [link=https://app.confident-ai.com]https://app.confident-ai.com[/link] " - ) - webbrowser.open("https://app.confident-ai.com") - if api_key == "": - while True: - api_key = input("Paste your API Key: ").strip() - if api_key: - break - else: - print("API Key cannot be empty. Please try again.\n") + # Use the confident_api_key if it is provided, otherwise proceed with existing logic + if confident_api_key: + api_key = confident_api_key + else: + """Login to the DeepEval platform.""" + print("Welcome to [bold]DeepEval[/bold]!") + print( + "Login and grab your API key here: [link=https://app.confident-ai.com]https://app.confident-ai.com[/link] " + ) + webbrowser.open("https://app.confident-ai.com") + if api_key == "": + while True: + api_key = input("Paste your API Key: ").strip() + if api_key: + break + else: + print("API Key cannot be empty. Please try again.\n") + KEY_FILE_HANDLER.write_api_key(api_key) client = Api(api_key=api_key) print("Congratulations! Login successful :raising_hands: ") diff --git a/pyproject.toml b/pyproject.toml index c8bc734b5..9de73be00 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "deepeval" -version = "0.20.29" +version = "0.20.30" description = "The Evaluation Framework for LLMs" authors = ["Jeffrey Ip "] license = "Apache-2.0"