Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath-runtime"
version = "0.11.8"
version = "0.11.9"
description = "Runtime abstractions and interfaces for building agents and automation scripts in the UiPath ecosystem"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
Expand Down
4 changes: 4 additions & 0 deletions src/uipath/runtime/workspace/hydration.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ async def dispose(self) -> None:
finally:
await self.workspace.dispose()

def __getattr__(self, name: str) -> Any:
"""Forward unknown attributes to the wrapped runtime."""
return getattr(self.delegate, name)
Comment on lines +97 to +99

async def _hydrate(self) -> None:
registry = await self.registry_store.load()
hydrated = await self.hydrator.hydrate(registry)
Expand Down
21 changes: 20 additions & 1 deletion tests/workspace/test_workspace_hydration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import shutil
import uuid
from pathlib import Path
from typing import Any, AsyncGenerator
from typing import Any, AsyncGenerator, cast

import pytest

Expand Down Expand Up @@ -100,6 +100,7 @@ def __init__(self, workspace_path: Path, status: UiPathRuntimeStatus) -> None:
self.workspace_path = workspace_path
self.status = status
self.disposed = False
self.runtime_id = "runtime-1"

async def execute(
self,
Expand Down Expand Up @@ -257,6 +258,24 @@ async def test_hydrate_skips_unchanged_local_file(tmp_path: Path) -> None:
assert attachments.downloads == 0


def test_hydration_runtime_forwards_delegate_attributes(tmp_path: Path) -> None:
workspace = Workspace.create(tmp_path / "workspace")
delegate = WritingRuntime(workspace.path, UiPathRuntimeStatus.SUCCESSFUL)
runtime = HydrationRuntime(
delegate,
workspace=workspace,
hydrator=WorkspaceHydrator(
workspace_path=workspace.path,
attachments=FakeAttachments(),
),
registry_store=WorkspaceRegistryStore(MemoryStorage(), "runtime-1"),
)

forwarded_runtime = cast(Any, runtime)
assert forwarded_runtime.runtime_id == "runtime-1"
assert forwarded_runtime.workspace_path == workspace.path
Comment on lines +261 to +276


@pytest.mark.asyncio
async def test_workspace_dispose_removes_temp_dir(tmp_path: Path) -> None:
workspace = Workspace.create(tmp_path / "workspace", cleanup=True)
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading