Skip to content
Open
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 packages/uipath/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath"
version = "2.14.41"
version = "2.14.42"
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"
Expand Down
7 changes: 5 additions & 2 deletions packages/uipath/src/uipath/_cli/cli_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from uipath._cli.models.runtime_schema import Bindings, EntryPoint, EntryPoints
from uipath._cli.models.uipath_json_schema import UiPathJsonConfig
from uipath.eval.constants import EVALS_FOLDER, LEGACY_EVAL_FOLDER
from uipath.eval.constants import EVALS_FOLDER
from uipath.platform.common import UiPathConfig
from uipath.platform.constants import (
ENTRY_POINTS_FILE,
Expand Down Expand Up @@ -318,11 +318,14 @@ def pack_fn(
metadata_files[f"{project_name}.nuspec"] = nuspec_content
metadata_files["_rels/.rels"] = rels_content

# Studio Web's Evaluations panel stores a project's datasets under `evals/`,
# so that folder ships with the package. `evaluations/`, the folder
# `uipath eval` reads, stays out of it.
files, skipped_files = files_to_include(
config_data.pack_options,
directory,
include_uv_lock,
directories_to_ignore=[LEGACY_EVAL_FOLDER, EVALS_FOLDER],
directories_to_ignore=[EVALS_FOLDER],
)

raise_on_metadata_conflicts(metadata_files, files)
Expand Down
51 changes: 40 additions & 11 deletions packages/uipath/tests/cli/test_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,13 +1087,13 @@ def test_bindings_v2_naming_in_nupkg(
assert bindings_v2_data["resources"][0]["resource"] == "asset"
assert bindings_v2_data["resources"][0]["key"] == "test-asset"

def test_evals_and_evaluations_directories_excluded(
def test_evals_directory_ships_and_evaluations_directory_excluded(
self,
runner: CliRunner,
temp_dir: str,
project_details: ProjectDetails,
) -> None:
"""Test that evals and evaluations directories are excluded from the nupkg."""
"""Test that evals/ ships byte-identical while evaluations/ stays out of the nupkg."""
with runner.isolated_filesystem(temp_dir=temp_dir):
with open("uipath.json", "w") as f:
json.dump(create_uipath_json(), f)
Expand All @@ -1102,14 +1102,29 @@ def test_evals_and_evaluations_directories_excluded(
with open("main.py", "w") as f:
f.write("def main(input): return input")

os.makedirs("evals")
os.makedirs("evaluations")
# Hand-formatted on purpose: a packager that parsed and re-serialized
# the dataset would change these bytes.
eval_set_json = '{\n "name": "smoke",\n "rows": [{ "x": 1 }]\n}\n'

# Where Studio Web's Evaluations panel writes datasets: ships.
os.makedirs("evals/default/eval-sets")
with open("evals/default/eval-sets/x.json", "w") as f:
f.write(eval_set_json)
# A stray file directly in evals/ breaks Studio Web's project
# migration (SRE-522088), so it stays out, as it does on push.
with open("evals/stray.json", "w") as f:
f.write("{}")
# The folder `uipath eval` reads, and local-only state: none of it ships.
os.makedirs("evaluations/eval-sets")
with open("evaluations/eval-sets/legacy.json", "w") as f:
f.write("{}")
os.makedirs(".local")
with open(".local/state.json", "w") as f:
f.write("{}")
os.makedirs(".venv")
with open(".venv/pyvenv.cfg", "w") as f:
f.write("home = /usr/bin\n")
os.makedirs("other_dir")

with open("evals/test_eval.json", "w") as f:
f.write('{"eval": "data"}')
with open("evaluations/test_evaluation.json", "w") as f:
f.write('{"evaluation": "data"}')
with open("other_dir/included.json", "w") as f:
f.write('{"should": "be included"}')

Expand All @@ -1128,10 +1143,24 @@ def test_evals_and_evaluations_directories_excluded(
assert os.path.exists(nupkg_path)

with zipfile.ZipFile(nupkg_path, "r") as z:
assert "content/evals/test_eval.json" not in z.namelist()
assert "content/evaluations/test_evaluation.json" not in z.namelist()
assert (
z.read("content/evals/default/eval-sets/x.json").decode("utf-8")
== eval_set_json
)
assert "content/evals/stray.json" not in z.namelist()
assert "content/other_dir/included.json" in z.namelist()

excluded_folders = (
"content/evaluations/",
"content/.local/",
"content/.venv/",
)
assert [
entry
for entry in z.namelist()
if entry.startswith(excluded_folders)
] == []

def test_generate_operate_file(self, runner: CliRunner, temp_dir: str) -> None:
"""Test generating operate.json from entry-points."""
from uipath._cli.models.runtime_schema import EntryPoint
Expand Down
2 changes: 1 addition & 1 deletion packages/uipath/uv.lock

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

Loading