From 47d3be7922a0b18357daca632f2735c68bc2ad15 Mon Sep 17 00:00:00 2001 From: Vlad Cimpeanu Date: Wed, 10 Jun 2026 15:42:03 +0300 Subject: [PATCH 1/8] chore: consolidate uipath constants into uipath-platform MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The constants in uipath/_utils/constants.py and uipath-platform/.../common/constants.py have drifted into two near-identical modules — 53 shared symbols (identical values) with 6 symbols only in uipath-platform and 1 (LLMV4_REQUEST) only in uipath/_utils. External packages (uipath-llm-client-python, uipath-langchain-python) import from uipath.platform.common.constants. Internal uipath consumers import from uipath._utils.constants. A silent value drift between the two would create hard-to-debug cross-package bugs — same name, different value. Changes: - Add LLMV4_REQUEST to uipath-platform.common.constants so it becomes a strict superset of the previous content of uipath._utils.constants. - Replace uipath/_utils/constants.py with a re-export shim that emits a FutureWarning on import, telling consumers to migrate to uipath.platform.common.constants. - Migrate the 3 internal consumers (_cli/__init__.py, _cli/_utils/_studio_project.py, _cli/_evals/_progress_reporter.py) to import from the canonical path so uipath itself doesn't trigger its own deprecation warning. The shim preserves backward compatibility for any external consumer that may still import via uipath._utils.constants; they'll see the warning and can migrate at their own pace. Co-Authored-By: Claude Opus 4.7 --- .../src/uipath/platform/common/constants.py | 1 + packages/uipath/src/uipath/_cli/__init__.py | 2 +- .../uipath/_cli/_evals/_progress_reporter.py | 2 +- .../src/uipath/_cli/_utils/_studio_project.py | 2 +- .../uipath/src/uipath/_utils/constants.py | 97 +++---------------- 5 files changed, 16 insertions(+), 88 deletions(-) diff --git a/packages/uipath-platform/src/uipath/platform/common/constants.py b/packages/uipath-platform/src/uipath/platform/common/constants.py index 304ef64a6..8f0b955c3 100644 --- a/packages/uipath-platform/src/uipath/platform/common/constants.py +++ b/packages/uipath-platform/src/uipath/platform/common/constants.py @@ -68,6 +68,7 @@ DROPBOX_DATA_SOURCE = "#UiPath.Vdbs.Domain.Api.V20Models.DropboxDataSource" GOOGLE_DRIVE_DATA_SOURCE = "#UiPath.Vdbs.Domain.Api.V20Models.GoogleDriveDataSource" ONEDRIVE_DATA_SOURCE = "#UiPath.Vdbs.Domain.Api.V20Models.OneDriveDataSource" +LLMV4_REQUEST = "#UiPath.Vdbs.Domain.Api.V20Models.LLMV4PreProcessingRequest" # Local storage diff --git a/packages/uipath/src/uipath/_cli/__init__.py b/packages/uipath/src/uipath/_cli/__init__.py index d8d3a8a46..e48b3d4d3 100644 --- a/packages/uipath/src/uipath/_cli/__init__.py +++ b/packages/uipath/src/uipath/_cli/__init__.py @@ -7,7 +7,7 @@ from uipath._cli._utils._context import CliContext from uipath._utils._logs import setup_logging -from uipath._utils.constants import DOTENV_FILE +from uipath.platform.common.constants import DOTENV_FILE # Windows console uses codepages (e.g. cp1252) that can't encode Unicode # characters used by Rich spinners (Braille) and emoji output. diff --git a/packages/uipath/src/uipath/_cli/_evals/_progress_reporter.py b/packages/uipath/src/uipath/_cli/_evals/_progress_reporter.py index fd4849076..3578d0b68 100644 --- a/packages/uipath/src/uipath/_cli/_evals/_progress_reporter.py +++ b/packages/uipath/src/uipath/_cli/_evals/_progress_reporter.py @@ -16,7 +16,7 @@ from uipath._cli._utils._console import ConsoleLogger from uipath._utils import Endpoint, RequestSpec -from uipath._utils.constants import ( +from uipath.platform.common.constants import ( ENV_EVAL_BACKEND_URL, ENV_TENANT_ID, HEADER_INTERNAL_TENANT_ID, diff --git a/packages/uipath/src/uipath/_cli/_utils/_studio_project.py b/packages/uipath/src/uipath/_cli/_utils/_studio_project.py index f70c3e96a..eb9e3ebb6 100644 --- a/packages/uipath/src/uipath/_cli/_utils/_studio_project.py +++ b/packages/uipath/src/uipath/_cli/_utils/_studio_project.py @@ -8,7 +8,7 @@ from pydantic import BaseModel, ConfigDict, Field, field_validator -from uipath._utils.constants import ( +from uipath.platform.common.constants import ( ENV_TENANT_ID, HEADER_SW_LOCK_KEY, HEADER_TENANT_ID, diff --git a/packages/uipath/src/uipath/_utils/constants.py b/packages/uipath/src/uipath/_utils/constants.py index e5a2c06da..4835f2e6d 100644 --- a/packages/uipath/src/uipath/_utils/constants.py +++ b/packages/uipath/src/uipath/_utils/constants.py @@ -1,89 +1,16 @@ -# Environment variables -DOTENV_FILE = ".env" -ENV_BASE_URL = "UIPATH_URL" -ENV_EVAL_BACKEND_URL = "UIPATH_EVAL_BACKEND_URL" -ENV_UNATTENDED_USER_ACCESS_TOKEN = "UNATTENDED_USER_ACCESS_TOKEN" -ENV_UIPATH_ACCESS_TOKEN = "UIPATH_ACCESS_TOKEN" -ENV_FOLDER_KEY = "UIPATH_FOLDER_KEY" -ENV_FOLDER_PATH = "UIPATH_FOLDER_PATH" -ENV_JOB_KEY = "UIPATH_JOB_KEY" -ENV_JOB_ID = "UIPATH_JOB_ID" -ENV_ROBOT_KEY = "UIPATH_ROBOT_KEY" -ENV_TENANT_ID = "UIPATH_TENANT_ID" -ENV_TENANT_NAME = "UIPATH_TENANT_NAME" -ENV_ORGANIZATION_ID = "UIPATH_ORGANIZATION_ID" -ENV_TELEMETRY_ENABLED = "UIPATH_TELEMETRY_ENABLED" -ENV_TRACING_ENABLED = "UIPATH_TRACING_ENABLED" -ENV_UIPATH_PROJECT_ID = "UIPATH_PROJECT_ID" -ENV_PROJECT_KEY = "PROJECT_KEY" -ENV_PROCESS_KEY = "UIPATH_PROCESS_KEY" -ENV_UIPATH_PROCESS_UUID = "UIPATH_PROCESS_UUID" -ENV_UIPATH_TRACE_ID = "UIPATH_TRACE_ID" -ENV_UIPATH_PROCESS_VERSION = "UIPATH_PROCESS_VERSION" +"""Deprecated alias for ``uipath.platform.common.constants``. -# Headers -HEADER_AGENTHUB_CONFIG = "x-uipath-agenthub-config" -HEADER_FOLDER_KEY = "x-uipath-folderkey" -HEADER_FOLDER_PATH = "x-uipath-folderpath" -HEADER_FOLDER_PATH_ENCODED = "x-uipath-folderpath-encoded" -HEADER_INTERNAL_ACCOUNT_ID = "x-uipath-internal-accountid" -HEADER_INTERNAL_TENANT_ID = "x-uipath-internal-tenantid" -HEADER_JOB_KEY = "x-uipath-jobkey" -HEADER_LLMGATEWAY_BYO_CONNECTION_ID = "x-uipath-llmgateway-byoisconnectionid" -HEADER_PROCESS_KEY = "x-uipath-processkey" -HEADER_SW_LOCK_KEY = "x-uipath-sw-lockkey" -HEADER_TENANT_ID = "x-uipath-tenantid" -HEADER_TRACE_ID = "x-uipath-traceid" -HEADER_USER_AGENT = "x-uipath-user-agent" +This module is kept as a backward-compatibility shim so existing imports keep +working. New code should import from ``uipath.platform.common.constants``. +""" -# Data sources (request types) -ORCHESTRATOR_STORAGE_BUCKET_DATA_SOURCE_REQUEST = ( - "#UiPath.Vdbs.Domain.Api.V20Models.StorageBucketDataSourceRequest" -) -CONFLUENCE_DATA_SOURCE_REQUEST = ( - "#UiPath.Vdbs.Domain.Api.V20Models.ConfluenceDataSourceRequest" -) -DROPBOX_DATA_SOURCE_REQUEST = ( - "#UiPath.Vdbs.Domain.Api.V20Models.DropboxDataSourceRequest" -) -GOOGLE_DRIVE_DATA_SOURCE_REQUEST = ( - "#UiPath.Vdbs.Domain.Api.V20Models.GoogleDriveDataSourceRequest" -) -ONEDRIVE_DATA_SOURCE_REQUEST = ( - "#UiPath.Vdbs.Domain.Api.V20Models.OneDriveDataSourceRequest" -) - -# Data sources -ORCHESTRATOR_STORAGE_BUCKET_DATA_SOURCE = ( - "#UiPath.Vdbs.Domain.Api.V20Models.StorageBucketDataSource" -) -CONFLUENCE_DATA_SOURCE = "#UiPath.Vdbs.Domain.Api.V20Models.ConfluenceDataSource" -DROPBOX_DATA_SOURCE = "#UiPath.Vdbs.Domain.Api.V20Models.DropboxDataSource" -GOOGLE_DRIVE_DATA_SOURCE = "#UiPath.Vdbs.Domain.Api.V20Models.GoogleDriveDataSource" -ONEDRIVE_DATA_SOURCE = "#UiPath.Vdbs.Domain.Api.V20Models.OneDriveDataSource" +import warnings -# Preprocessing request types -LLMV3Mini_REQUEST = "#UiPath.Vdbs.Domain.Api.V20Models.LLMV3MiniPreProcessingRequest" -LLMV4_REQUEST = "#UiPath.Vdbs.Domain.Api.V20Models.LLMV4PreProcessingRequest" -NativeV1_REQUEST = "#UiPath.Vdbs.Domain.Api.V20Models.NativeV1PreProcessingRequest" +from uipath.platform.common.constants import * # noqa: F401,F403 - -# Local storage -TEMP_ATTACHMENTS_FOLDER = "uipath_attachments" - -# LLM models -COMMUNITY_agents_SUFFIX = "-community-agents" - -# File names -PYTHON_CONFIGURATION_FILE = "pyproject.toml" -UIPATH_CONFIG_FILE = "uipath.json" -UIPATH_BINDINGS_FILE = "bindings.json" -ENTRY_POINTS_FILE = "entry-points.json" -STUDIO_METADATA_FILE = "studio_metadata.json" - - -# Folder names -LEGACY_EVAL_FOLDER = "evals" -EVALS_FOLDER = "evaluations" -# Evaluators -CUSTOM_EVALUATOR_PREFIX = "file://" +warnings.warn( + "uipath._utils.constants is deprecated and will be removed in a future " + "release; import from uipath.platform.common.constants instead.", + FutureWarning, + stacklevel=2, +) From d50cde23ece4588c95d468a608829ae8946bbb2c Mon Sep 17 00:00:00 2001 From: Vlad Cimpeanu Date: Wed, 10 Jun 2026 15:46:09 +0300 Subject: [PATCH 2/8] chore: bump uipath-platform to 0.1.63 and uipath to 2.10.80 Bump versions for the constants consolidation: - uipath-platform 0.1.62 -> 0.1.63 (adds LLMV4_REQUEST) - uipath 2.10.79 -> 2.10.80 (shim + import migrations) - uipath's lower bound on uipath-platform bumped to >=0.1.63 so the shim's star-import resolves LLMV4_REQUEST in any installable combination. Co-Authored-By: Claude Opus 4.7 --- packages/uipath-platform/pyproject.toml | 2 +- packages/uipath-platform/uv.lock | 2 +- packages/uipath/pyproject.toml | 4 ++-- packages/uipath/uv.lock | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/uipath-platform/pyproject.toml b/packages/uipath-platform/pyproject.toml index 4a5c0b83c..50dd25553 100644 --- a/packages/uipath-platform/pyproject.toml +++ b/packages/uipath-platform/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath-platform" -version = "0.1.62" +version = "0.1.63" description = "HTTP client library for programmatic access to UiPath Platform" readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.11" diff --git a/packages/uipath-platform/uv.lock b/packages/uipath-platform/uv.lock index ac4761377..2f56c1df5 100644 --- a/packages/uipath-platform/uv.lock +++ b/packages/uipath-platform/uv.lock @@ -1095,7 +1095,7 @@ dev = [ [[package]] name = "uipath-platform" -version = "0.1.62" +version = "0.1.63" source = { editable = "." } dependencies = [ { name = "httpx" }, diff --git a/packages/uipath/pyproject.toml b/packages/uipath/pyproject.toml index 2e490ade3..5b39aa620 100644 --- a/packages/uipath/pyproject.toml +++ b/packages/uipath/pyproject.toml @@ -1,13 +1,13 @@ [project] name = "uipath" -version = "2.10.79" +version = "2.10.80" description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools." readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.11" dependencies = [ "uipath-core>=0.5.17, <0.6.0", "uipath-runtime>=0.11.0, <0.12.0", - "uipath-platform>=0.1.60, <0.2.0", + "uipath-platform>=0.1.63, <0.2.0", "click>=8.3.1", "httpx>=0.28.1", "pyjwt>=2.10.1", diff --git a/packages/uipath/uv.lock b/packages/uipath/uv.lock index 476c94d05..a7ff91e80 100644 --- a/packages/uipath/uv.lock +++ b/packages/uipath/uv.lock @@ -2552,7 +2552,7 @@ wheels = [ [[package]] name = "uipath" -version = "2.10.79" +version = "2.10.80" source = { editable = "." } dependencies = [ { name = "applicationinsights" }, @@ -2691,7 +2691,7 @@ dev = [ [[package]] name = "uipath-platform" -version = "0.1.62" +version = "0.1.63" source = { editable = "../uipath-platform" } dependencies = [ { name = "httpx" }, From 08bfb30fa37f6a2ec4e06b48dc3177858480a31d Mon Sep 17 00:00:00 2001 From: Vlad Cimpeanu Date: Wed, 10 Jun 2026 16:21:00 +0300 Subject: [PATCH 3/8] chore: add missing constants Co-Authored-By: Claude Opus 4.7 --- .../uipath-platform/src/uipath/platform/common/constants.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/uipath-platform/src/uipath/platform/common/constants.py b/packages/uipath-platform/src/uipath/platform/common/constants.py index 8f0b955c3..4970f1e59 100644 --- a/packages/uipath-platform/src/uipath/platform/common/constants.py +++ b/packages/uipath-platform/src/uipath/platform/common/constants.py @@ -68,7 +68,9 @@ DROPBOX_DATA_SOURCE = "#UiPath.Vdbs.Domain.Api.V20Models.DropboxDataSource" GOOGLE_DRIVE_DATA_SOURCE = "#UiPath.Vdbs.Domain.Api.V20Models.GoogleDriveDataSource" ONEDRIVE_DATA_SOURCE = "#UiPath.Vdbs.Domain.Api.V20Models.OneDriveDataSource" +LLMV3Mini_REQUEST = "#UiPath.Vdbs.Domain.Api.V20Models.LLMV3MiniPreProcessingRequest" LLMV4_REQUEST = "#UiPath.Vdbs.Domain.Api.V20Models.LLMV4PreProcessingRequest" +NativeV1_REQUEST = "#UiPath.Vdbs.Domain.Api.V20Models.NativeV1PreProcessingRequest" # Local storage From 6b38e30c054c5954ecf8b08b3b69ff0fe4db2b37 Mon Sep 17 00:00:00 2001 From: Vlad Cimpeanu Date: Wed, 10 Jun 2026 16:30:53 +0300 Subject: [PATCH 4/8] fix: avoid leaking warnings into shim's public namespace Co-Authored-By: Claude Opus 4.7 --- packages/uipath/src/uipath/_utils/constants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/uipath/src/uipath/_utils/constants.py b/packages/uipath/src/uipath/_utils/constants.py index 4835f2e6d..186a55352 100644 --- a/packages/uipath/src/uipath/_utils/constants.py +++ b/packages/uipath/src/uipath/_utils/constants.py @@ -4,11 +4,11 @@ working. New code should import from ``uipath.platform.common.constants``. """ -import warnings +import warnings as _warnings from uipath.platform.common.constants import * # noqa: F401,F403 -warnings.warn( +_warnings.warn( "uipath._utils.constants is deprecated and will be removed in a future " "release; import from uipath.platform.common.constants instead.", FutureWarning, From 82594c60fef70d3b104d97db7ba09c93444c58bf Mon Sep 17 00:00:00 2001 From: Vlad Cimpeanu Date: Wed, 10 Jun 2026 16:56:16 +0300 Subject: [PATCH 5/8] chore: migrate remaining shim consumers to canonical path Co-Authored-By: Claude Opus 4.7 --- packages/uipath/src/uipath/_cli/_utils/_common.py | 2 +- packages/uipath/src/uipath/_cli/cli_init.py | 2 +- packages/uipath/src/uipath/_utils/_auth.py | 2 +- packages/uipath/src/uipath/_utils/_request_override.py | 6 +++++- packages/uipath/src/uipath/_utils/_user_agent.py | 2 +- .../src/uipath/eval/evaluators/legacy_evaluator_utils.py | 2 +- .../uipath/eval/evaluators/legacy_llm_as_judge_evaluator.py | 2 +- .../uipath/eval/evaluators/legacy_trajectory_evaluator.py | 2 +- packages/uipath/src/uipath/telemetry/_track.py | 2 +- 9 files changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/uipath/src/uipath/_cli/_utils/_common.py b/packages/uipath/src/uipath/_cli/_utils/_common.py index c24bccff0..53a113831 100644 --- a/packages/uipath/src/uipath/_cli/_utils/_common.py +++ b/packages/uipath/src/uipath/_cli/_utils/_common.py @@ -14,7 +14,7 @@ UiPathConfig, ) -from ..._utils.constants import ENV_UIPATH_ACCESS_TOKEN +from uipath.platform.common.constants import ENV_UIPATH_ACCESS_TOKEN from ..models.runtime_schema import EntryPoint from ..spinner import Spinner from ._console import ConsoleLogger diff --git a/packages/uipath/src/uipath/_cli/cli_init.py b/packages/uipath/src/uipath/_cli/cli_init.py index 80396d8ff..d11b9683d 100644 --- a/packages/uipath/src/uipath/_cli/cli_init.py +++ b/packages/uipath/src/uipath/_cli/cli_init.py @@ -30,7 +30,7 @@ ) from uipath.runtime.schema import UiPathRuntimeGraph, UiPathRuntimeSchema -from .._utils.constants import ENV_TELEMETRY_ENABLED +from uipath.platform.common.constants import ENV_TELEMETRY_ENABLED from ..telemetry._constants import _PROJECT_KEY, _TELEMETRY_CONFIG_FILE from ._telemetry import track_command from ._utils._common import determine_project_type diff --git a/packages/uipath/src/uipath/_utils/_auth.py b/packages/uipath/src/uipath/_utils/_auth.py index 6f83fd0a2..6818a474f 100644 --- a/packages/uipath/src/uipath/_utils/_auth.py +++ b/packages/uipath/src/uipath/_utils/_auth.py @@ -4,7 +4,7 @@ from pathlib import Path from typing import Optional -from .constants import ( +from uipath.platform.common.constants import ( ENV_BASE_URL, ENV_UIPATH_ACCESS_TOKEN, ENV_UNATTENDED_USER_ACCESS_TOKEN, diff --git a/packages/uipath/src/uipath/_utils/_request_override.py b/packages/uipath/src/uipath/_utils/_request_override.py index 07d5e2ebc..f2bc3c062 100644 --- a/packages/uipath/src/uipath/_utils/_request_override.py +++ b/packages/uipath/src/uipath/_utils/_request_override.py @@ -1,7 +1,11 @@ from base64 import b64encode from typing import Optional -from .constants import HEADER_FOLDER_KEY, HEADER_FOLDER_PATH, HEADER_FOLDER_PATH_ENCODED +from uipath.platform.common.constants import ( + HEADER_FOLDER_KEY, + HEADER_FOLDER_PATH, + HEADER_FOLDER_PATH_ENCODED, +) def folder_path_header(folder_path: str) -> dict[str, str]: diff --git a/packages/uipath/src/uipath/_utils/_user_agent.py b/packages/uipath/src/uipath/_utils/_user_agent.py index dcf28d3e0..0b930d917 100644 --- a/packages/uipath/src/uipath/_utils/_user_agent.py +++ b/packages/uipath/src/uipath/_utils/_user_agent.py @@ -1,6 +1,6 @@ import importlib -from .constants import HEADER_USER_AGENT +from uipath.platform.common.constants import HEADER_USER_AGENT def user_agent_value(specific_component: str) -> str: diff --git a/packages/uipath/src/uipath/eval/evaluators/legacy_evaluator_utils.py b/packages/uipath/src/uipath/eval/evaluators/legacy_evaluator_utils.py index b8c20f372..4bd241eaa 100644 --- a/packages/uipath/src/uipath/eval/evaluators/legacy_evaluator_utils.py +++ b/packages/uipath/src/uipath/eval/evaluators/legacy_evaluator_utils.py @@ -3,7 +3,7 @@ import json from typing import Any, Optional -from ..._utils.constants import COMMUNITY_agents_SUFFIX +from uipath.platform.common.constants import COMMUNITY_agents_SUFFIX def clean_model_name(model: str) -> str: diff --git a/packages/uipath/src/uipath/eval/evaluators/legacy_llm_as_judge_evaluator.py b/packages/uipath/src/uipath/eval/evaluators/legacy_llm_as_judge_evaluator.py index 0c676ac9b..ce2c579c1 100644 --- a/packages/uipath/src/uipath/eval/evaluators/legacy_llm_as_judge_evaluator.py +++ b/packages/uipath/src/uipath/eval/evaluators/legacy_llm_as_judge_evaluator.py @@ -9,7 +9,7 @@ from uipath.platform.chat import UiPathLlmChatService from uipath.platform.chat.llm_gateway import RequiredToolChoice -from ..._utils.constants import COMMUNITY_agents_SUFFIX +from uipath.platform.common.constants import COMMUNITY_agents_SUFFIX from .._execution_context import eval_set_run_id_context from .._helpers.helpers import is_empty_value from .._helpers.output_path import resolve_output_path diff --git a/packages/uipath/src/uipath/eval/evaluators/legacy_trajectory_evaluator.py b/packages/uipath/src/uipath/eval/evaluators/legacy_trajectory_evaluator.py index cff0e8788..1af292b46 100644 --- a/packages/uipath/src/uipath/eval/evaluators/legacy_trajectory_evaluator.py +++ b/packages/uipath/src/uipath/eval/evaluators/legacy_trajectory_evaluator.py @@ -10,7 +10,7 @@ from uipath.platform.chat import UiPathLlmChatService from uipath.platform.chat.llm_gateway import RequiredToolChoice -from ..._utils.constants import COMMUNITY_agents_SUFFIX +from uipath.platform.common.constants import COMMUNITY_agents_SUFFIX from .._execution_context import eval_set_run_id_context from .._helpers.evaluators_helpers import trace_to_str from .._helpers.helpers import is_empty_value diff --git a/packages/uipath/src/uipath/telemetry/_track.py b/packages/uipath/src/uipath/telemetry/_track.py index 2d3f11ebf..873ae1dad 100644 --- a/packages/uipath/src/uipath/telemetry/_track.py +++ b/packages/uipath/src/uipath/telemetry/_track.py @@ -9,7 +9,7 @@ from opentelemetry.sdk._logs import LoggingHandler from opentelemetry.util.types import AnyValue -from .._utils.constants import ( +from uipath.platform.common.constants import ( ENV_BASE_URL, ENV_ORGANIZATION_ID, ENV_TELEMETRY_ENABLED, From 164517ca32734efa0f12b4d8f452aeb7c1e71b8a Mon Sep 17 00:00:00 2001 From: Vlad Cimpeanu Date: Wed, 10 Jun 2026 17:17:30 +0300 Subject: [PATCH 6/8] chore: ruff format imports after consolidation Co-Authored-By: Claude Opus 4.7 --- .../src/uipath/_cli/_evals/_progress_reporter.py | 10 +++++----- packages/uipath/src/uipath/_cli/_utils/_common.py | 2 +- .../uipath/src/uipath/_cli/_utils/_studio_project.py | 12 ++++++------ packages/uipath/src/uipath/_cli/cli_init.py | 2 +- .../eval/evaluators/legacy_llm_as_judge_evaluator.py | 2 +- .../eval/evaluators/legacy_trajectory_evaluator.py | 2 +- packages/uipath/src/uipath/telemetry/_track.py | 1 + 7 files changed, 16 insertions(+), 15 deletions(-) diff --git a/packages/uipath/src/uipath/_cli/_evals/_progress_reporter.py b/packages/uipath/src/uipath/_cli/_evals/_progress_reporter.py index 3578d0b68..ed4ffc656 100644 --- a/packages/uipath/src/uipath/_cli/_evals/_progress_reporter.py +++ b/packages/uipath/src/uipath/_cli/_evals/_progress_reporter.py @@ -16,11 +16,6 @@ from uipath._cli._utils._console import ConsoleLogger from uipath._utils import Endpoint, RequestSpec -from uipath.platform.common.constants import ( - ENV_EVAL_BACKEND_URL, - ENV_TENANT_ID, - HEADER_INTERNAL_TENANT_ID, -) from uipath.core.events import EventBus from uipath.eval.evaluators import ( BaseEvaluator, @@ -38,6 +33,11 @@ ) from uipath.platform import UiPath from uipath.platform.common import UiPathConfig +from uipath.platform.common.constants import ( + ENV_EVAL_BACKEND_URL, + ENV_TENANT_ID, + HEADER_INTERNAL_TENANT_ID, +) logger = logging.getLogger(__name__) diff --git a/packages/uipath/src/uipath/_cli/_utils/_common.py b/packages/uipath/src/uipath/_cli/_utils/_common.py index 53a113831..5320e226d 100644 --- a/packages/uipath/src/uipath/_cli/_utils/_common.py +++ b/packages/uipath/src/uipath/_cli/_utils/_common.py @@ -13,8 +13,8 @@ ResourceOverwriteParser, UiPathConfig, ) - from uipath.platform.common.constants import ENV_UIPATH_ACCESS_TOKEN + from ..models.runtime_schema import EntryPoint from ..spinner import Spinner from ._console import ConsoleLogger diff --git a/packages/uipath/src/uipath/_cli/_utils/_studio_project.py b/packages/uipath/src/uipath/_cli/_utils/_studio_project.py index eb9e3ebb6..eb9e06d29 100644 --- a/packages/uipath/src/uipath/_cli/_utils/_studio_project.py +++ b/packages/uipath/src/uipath/_cli/_utils/_studio_project.py @@ -8,6 +8,12 @@ from pydantic import BaseModel, ConfigDict, Field, field_validator +from uipath.platform import UiPath +from uipath.platform.common import ( + ResourceOverwrite, + ResourceOverwriteParser, + UiPathConfig, +) from uipath.platform.common.constants import ( ENV_TENANT_ID, HEADER_SW_LOCK_KEY, @@ -15,12 +21,6 @@ PYTHON_CONFIGURATION_FILE, STUDIO_METADATA_FILE, ) -from uipath.platform import UiPath -from uipath.platform.common import ( - ResourceOverwrite, - ResourceOverwriteParser, - UiPathConfig, -) from uipath.platform.errors import EnrichedException from uipath.tracing import traced diff --git a/packages/uipath/src/uipath/_cli/cli_init.py b/packages/uipath/src/uipath/_cli/cli_init.py index d11b9683d..4d9e8c199 100644 --- a/packages/uipath/src/uipath/_cli/cli_init.py +++ b/packages/uipath/src/uipath/_cli/cli_init.py @@ -22,6 +22,7 @@ ) from uipath.platform.common import UiPathConfig +from uipath.platform.common.constants import ENV_TELEMETRY_ENABLED from uipath.runtime import ( UiPathRuntimeContext, UiPathRuntimeFactoryProtocol, @@ -30,7 +31,6 @@ ) from uipath.runtime.schema import UiPathRuntimeGraph, UiPathRuntimeSchema -from uipath.platform.common.constants import ENV_TELEMETRY_ENABLED from ..telemetry._constants import _PROJECT_KEY, _TELEMETRY_CONFIG_FILE from ._telemetry import track_command from ._utils._common import determine_project_type diff --git a/packages/uipath/src/uipath/eval/evaluators/legacy_llm_as_judge_evaluator.py b/packages/uipath/src/uipath/eval/evaluators/legacy_llm_as_judge_evaluator.py index ce2c579c1..f3fd6226a 100644 --- a/packages/uipath/src/uipath/eval/evaluators/legacy_llm_as_judge_evaluator.py +++ b/packages/uipath/src/uipath/eval/evaluators/legacy_llm_as_judge_evaluator.py @@ -8,8 +8,8 @@ from uipath.platform import UiPath from uipath.platform.chat import UiPathLlmChatService from uipath.platform.chat.llm_gateway import RequiredToolChoice - from uipath.platform.common.constants import COMMUNITY_agents_SUFFIX + from .._execution_context import eval_set_run_id_context from .._helpers.helpers import is_empty_value from .._helpers.output_path import resolve_output_path diff --git a/packages/uipath/src/uipath/eval/evaluators/legacy_trajectory_evaluator.py b/packages/uipath/src/uipath/eval/evaluators/legacy_trajectory_evaluator.py index 1af292b46..772005d37 100644 --- a/packages/uipath/src/uipath/eval/evaluators/legacy_trajectory_evaluator.py +++ b/packages/uipath/src/uipath/eval/evaluators/legacy_trajectory_evaluator.py @@ -9,8 +9,8 @@ from uipath.platform import UiPath from uipath.platform.chat import UiPathLlmChatService from uipath.platform.chat.llm_gateway import RequiredToolChoice - from uipath.platform.common.constants import COMMUNITY_agents_SUFFIX + from .._execution_context import eval_set_run_id_context from .._helpers.evaluators_helpers import trace_to_str from .._helpers.helpers import is_empty_value diff --git a/packages/uipath/src/uipath/telemetry/_track.py b/packages/uipath/src/uipath/telemetry/_track.py index 873ae1dad..44c2850ff 100644 --- a/packages/uipath/src/uipath/telemetry/_track.py +++ b/packages/uipath/src/uipath/telemetry/_track.py @@ -15,6 +15,7 @@ ENV_TELEMETRY_ENABLED, ENV_TENANT_ID, ) + from ._constants import ( _APP_INSIGHTS_EVENT_MARKER_ATTRIBUTE, _APP_NAME, From 36ecd65471d4a8b7da1c50146790ce2d072dcf14 Mon Sep 17 00:00:00 2001 From: Vlad Cimpeanu Date: Wed, 10 Jun 2026 17:34:15 +0300 Subject: [PATCH 7/8] test: cover uipath._utils.constants deprecation shim Co-Authored-By: Claude Opus 4.7 --- .../tests/sdk/test_utils_constants_shim.py | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 packages/uipath/tests/sdk/test_utils_constants_shim.py diff --git a/packages/uipath/tests/sdk/test_utils_constants_shim.py b/packages/uipath/tests/sdk/test_utils_constants_shim.py new file mode 100644 index 000000000..e12ee6c38 --- /dev/null +++ b/packages/uipath/tests/sdk/test_utils_constants_shim.py @@ -0,0 +1,80 @@ +"""Regression tests for the uipath._utils.constants deprecation shim. + +The shim re-exports from uipath.platform.common.constants and emits a +FutureWarning so external consumers can migrate. Internal callsites are +already on the canonical path; these tests pin the shim's behavior so it +keeps working for downstream code. +""" + +import importlib +import sys +import warnings + + +def _reload_shim(): + """Force a fresh import of the shim so FutureWarning re-fires.""" + for name in [ + "uipath._utils.constants", + "uipath.platform.common.constants", + ]: + sys.modules.pop(name, None) + return importlib.import_module("uipath._utils.constants") + + +def test_shim_emits_future_warning(): + with warnings.catch_warnings(record=True) as caught: + warnings.simplefilter("always") + _reload_shim() + + shim_warnings = [ + w + for w in caught + if issubclass(w.category, FutureWarning) + and "uipath._utils.constants" in str(w.message) + and "uipath.platform.common.constants" in str(w.message) + ] + assert len(shim_warnings) == 1, ( + f"expected exactly one shim FutureWarning, got {len(shim_warnings)}: " + f"{[str(w.message) for w in caught]}" + ) + + +def test_shim_re_exports_canonical_symbols(): + shim = _reload_shim() + canonical = importlib.import_module("uipath.platform.common.constants") + + # Sample a representative set: env vars, headers, mixed-case symbols, + # file constants, data-source magic strings. + sample = [ + "DOTENV_FILE", + "ENV_BASE_URL", + "ENV_TENANT_ID", + "HEADER_INTERNAL_TENANT_ID", + "HEADER_INTERNAL_ACCOUNT_ID", + "HEADER_USER_AGENT", + "LLMV3Mini_REQUEST", + "LLMV4_REQUEST", + "NativeV1_REQUEST", + "COMMUNITY_agents_SUFFIX", + "PYTHON_CONFIGURATION_FILE", + "ORCHESTRATOR_STORAGE_BUCKET_DATA_SOURCE_REQUEST", + ] + for name in sample: + assert hasattr(shim, name), f"shim missing {name}" + assert hasattr(canonical, name), f"canonical missing {name}" + assert getattr(shim, name) == getattr(canonical, name), ( + f"value drift for {name}: shim={getattr(shim, name)!r} " + f"canonical={getattr(canonical, name)!r}" + ) + + +def test_shim_does_not_leak_warnings_module_via_star_import(): + """The shim binds `warnings` under a private alias to keep it out of + `from uipath._utils.constants import *`.""" + _reload_shim() + ns: dict = {} + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + exec("from uipath._utils.constants import *", ns) + assert "warnings" not in ns + assert "_warnings" not in ns From 049a37321123198859fc68fa99d44bcadd5ca7e9 Mon Sep 17 00:00:00 2001 From: Vlad Cimpeanu Date: Wed, 10 Jun 2026 17:40:01 +0300 Subject: [PATCH 8/8] fix(test): annotate dict with type parameters for mypy Co-Authored-By: Claude Opus 4.7 --- packages/uipath/tests/sdk/test_utils_constants_shim.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/uipath/tests/sdk/test_utils_constants_shim.py b/packages/uipath/tests/sdk/test_utils_constants_shim.py index e12ee6c38..b5d038aa8 100644 --- a/packages/uipath/tests/sdk/test_utils_constants_shim.py +++ b/packages/uipath/tests/sdk/test_utils_constants_shim.py @@ -72,7 +72,7 @@ def test_shim_does_not_leak_warnings_module_via_star_import(): """The shim binds `warnings` under a private alias to keep it out of `from uipath._utils.constants import *`.""" _reload_shim() - ns: dict = {} + ns: dict[str, object] = {} with warnings.catch_warnings(): warnings.simplefilter("ignore") exec("from uipath._utils.constants import *", ns)