Skip to content

Commit 46d6ff2

Browse files
authored
fix: update runtime factory contracts (#1195)
1 parent 3c749b4 commit 46d6ff2

6 files changed

Lines changed: 55 additions & 26 deletions

File tree

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[project]
22
name = "uipath"
3-
version = "2.5.40"
3+
version = "2.6.0"
44
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"
77
dependencies = [
8-
"uipath-core>=0.1.10, <0.2.0",
9-
"uipath-runtime>=0.5.1, <0.6.0",
8+
"uipath-core>=0.2.0, <0.3.0",
9+
"uipath-runtime>=0.6.0, <0.7.0",
1010
"click>=8.3.1",
1111
"httpx>=0.28.1",
1212
"pyjwt>=2.10.1",

src/uipath/functions/factory.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
from pathlib import Path
66
from typing import Any
77

8-
from uipath.runtime import UiPathRuntimeProtocol
8+
from uipath.runtime import (
9+
UiPathRuntimeFactorySettings,
10+
UiPathRuntimeProtocol,
11+
UiPathRuntimeStorageProtocol,
12+
)
913

1014
from .runtime import UiPathFunctionsRuntime
1115

@@ -44,9 +48,13 @@ def discover_entrypoints(self) -> list[str]:
4448
config = self._load_config()
4549
return list(config.get("functions", {}).keys())
4650

47-
async def discover_runtimes(self) -> list[UiPathRuntimeProtocol]:
48-
"""Discover all runtime instances."""
49-
return [self._create_runtime(ep) for ep in self.discover_entrypoints()]
51+
async def get_storage(self) -> UiPathRuntimeStorageProtocol | None:
52+
"""Get storage protocol if any (placeholder for protocol compliance)."""
53+
return None
54+
55+
async def get_settings(self) -> UiPathRuntimeFactorySettings | None:
56+
"""Get factory settings if any (placeholder for protocol compliance)."""
57+
return None
5058

5159
async def new_runtime(
5260
self, entrypoint: str, runtime_id: str, **kwargs

tests/cli/eval/test_eval_runtime_metadata.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
from uipath.runtime import (
1717
UiPathExecuteOptions,
1818
UiPathRuntimeEvent,
19+
UiPathRuntimeFactorySettings,
1920
UiPathRuntimeProtocol,
2021
UiPathRuntimeResult,
2122
UiPathRuntimeStatus,
23+
UiPathRuntimeStorageProtocol,
2224
UiPathStreamOptions,
2325
)
2426
from uipath.runtime.schema import UiPathRuntimeSchema
@@ -114,8 +116,11 @@ def __init__(self, runtime_creator):
114116
def discover_entrypoints(self) -> list[str]:
115117
return ["test"]
116118

117-
async def discover_runtimes(self) -> list[UiPathRuntimeProtocol]:
118-
return [await self.runtime_creator()]
119+
async def get_storage(self) -> UiPathRuntimeStorageProtocol | None:
120+
return None
121+
122+
async def get_settings(self) -> UiPathRuntimeFactorySettings | None:
123+
return None
119124

120125
async def new_runtime(
121126
self, entrypoint: str, runtime_id: str, **kwargs

tests/cli/eval/test_eval_runtime_suspend_resume.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
from uipath.runtime import (
1616
UiPathExecuteOptions,
1717
UiPathRuntimeEvent,
18+
UiPathRuntimeFactorySettings,
1819
UiPathRuntimeProtocol,
1920
UiPathRuntimeResult,
2021
UiPathRuntimeStatus,
22+
UiPathRuntimeStorageProtocol,
2123
UiPathStreamOptions,
2224
)
2325
from uipath.runtime.schema import UiPathRuntimeSchema
@@ -112,8 +114,11 @@ def __init__(self, runtime_creator):
112114
def discover_entrypoints(self) -> list[str]:
113115
return ["test"]
114116

115-
async def discover_runtimes(self) -> list[UiPathRuntimeProtocol]:
116-
return [await self.runtime_creator()]
117+
async def get_storage(self) -> UiPathRuntimeStorageProtocol | None:
118+
return None
119+
120+
async def get_settings(self) -> UiPathRuntimeFactorySettings | None:
121+
return None
117122

118123
async def new_runtime(
119124
self, entrypoint: str, runtime_id: str, **kwargs

tests/cli/eval/test_evaluate.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
from uipath.runtime import (
77
UiPathExecuteOptions,
88
UiPathRuntimeEvent,
9+
UiPathRuntimeFactorySettings,
910
UiPathRuntimeProtocol,
1011
UiPathRuntimeResult,
1112
UiPathRuntimeStatus,
13+
UiPathRuntimeStorageProtocol,
1214
UiPathStreamOptions,
1315
)
1416
from uipath.runtime.schema import UiPathRuntimeSchema
@@ -75,8 +77,11 @@ def __init__(self, executor):
7577
def discover_entrypoints(self) -> list[str]:
7678
return ["test"]
7779

78-
async def discover_runtimes(self) -> list[UiPathRuntimeProtocol]:
79-
return [TestRuntime(self.executor)]
80+
async def get_storage(self) -> UiPathRuntimeStorageProtocol | None:
81+
return None
82+
83+
async def get_settings(self) -> UiPathRuntimeFactorySettings | None:
84+
return None
8085

8186
async def new_runtime(
8287
self, entrypoint: str, runtime_id: str, **kwargs
@@ -176,8 +181,11 @@ def __init__(self, executor):
176181
def discover_entrypoints(self) -> list[str]:
177182
return ["test"]
178183

179-
async def discover_runtimes(self) -> list[UiPathRuntimeProtocol]:
180-
return [TestRuntime(self.executor)]
184+
async def get_storage(self) -> UiPathRuntimeStorageProtocol | None:
185+
return None
186+
187+
async def get_settings(self) -> UiPathRuntimeFactorySettings | None:
188+
return None
181189

182190
async def new_runtime(
183191
self, entrypoint: str, runtime_id: str, **kwargs
@@ -262,8 +270,11 @@ def __init__(self, executor):
262270
def discover_entrypoints(self) -> list[str]:
263271
return ["test"]
264272

265-
async def discover_runtimes(self) -> list[UiPathRuntimeProtocol]:
266-
return [TestRuntime(self.executor)]
273+
async def get_storage(self) -> UiPathRuntimeStorageProtocol | None:
274+
return None
275+
276+
async def get_settings(self) -> UiPathRuntimeFactorySettings | None:
277+
return None
267278

268279
async def new_runtime(
269280
self, entrypoint: str, runtime_id: str, **kwargs

uv.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)