From 7406d2fb20659a1bd6ce95847b4b6934d8ed6698 Mon Sep 17 00:00:00 2001 From: Hanchi Wang Date: Thu, 19 Dec 2024 16:45:12 -0800 Subject: [PATCH] Fix get version for werkzeug --- pylintrc | 2 +- src/promptflow-devkit/tests/sdk_pfs_test/utils.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pylintrc b/pylintrc index bdb713cf12b..ad26bc6335a 100644 --- a/pylintrc +++ b/pylintrc @@ -1,7 +1,7 @@ [MASTER] py-version=3.9 ignore-patterns=test_*,conftest,setup,.*_utils\.py -ignore-paths=src\promptflow-evals\tests,src\promptflow-evals\samples,promptflow\evals\evaluate\_telemetry,promptflow\evals\evaluate\_batch_run_client\code_client.py,promptflow\evals\evaluate\_batch_run_client\proxy_client.py +ignore-paths=src\promptflow-evals\tests,src\promptflow-evals\samples,promptflow\evals\evaluate\_telemetry,promptflow\evals\evaluate\_batch_run_client\code_client.py,promptflow\evals\evaluate\_batch_run_client\proxy_client.py,src/promptflow-devkit/tests/sdk_pfs_test/utils.py reports=no [MESSAGES CONTROL] diff --git a/src/promptflow-devkit/tests/sdk_pfs_test/utils.py b/src/promptflow-devkit/tests/sdk_pfs_test/utils.py index 7213419bb6b..670bb528aff 100644 --- a/src/promptflow-devkit/tests/sdk_pfs_test/utils.py +++ b/src/promptflow-devkit/tests/sdk_pfs_test/utils.py @@ -3,11 +3,11 @@ # --------------------------------------------------------- import contextlib import getpass +import importlib.metadata import json from typing import Any, Dict, List, Optional from unittest import mock -import werkzeug from flask.testing import FlaskClient from promptflow._sdk._service.utils.utils import encrypt_flow_path @@ -34,7 +34,7 @@ def check_activity_end_telemetry( "first_call": True, "activity_type": "PublicApi", "completion_status": "Success", - "user_agent": [f"Werkzeug/{werkzeug.__version__}", f"local_pfs/{VERSION}"], + "user_agent": [f"Werkzeug/{importlib.metadata.version('werkzeug')}", f"local_pfs/{VERSION}"], } for i, expected_activity in enumerate(expected_activities): temp = default_expected_call.copy()