Skip to content

Commit b1b978e

Browse files
committed
fix: include subdir files in .nupkg
1 parent 9958a19 commit b1b978e

4 files changed

Lines changed: 28 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath"
3-
version = "2.1.15"
3+
version = "2.1.16"
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.10"

src/uipath/_cli/_utils/_project_files.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ def files_to_include(
329329
file_extensions_included.extend(settings["fileExtensionsIncluded"])
330330
if "filesIncluded" in settings:
331331
files_included.extend(settings["filesIncluded"])
332+
if directories_to_ignore is None:
333+
directories_to_ignore = []
332334

333335
def is_venv_dir(d: str) -> bool:
334336
"""Check if a directory is a Python virtual environment.

tests/cli/test_pack.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,30 @@ def test_include_files(
312312
assert f"content/{file_to_add}" in z.namelist()
313313
assert f"content/{random_file}" not in z.namelist()
314314

315+
def test_include_subdir_files(
316+
self,
317+
runner: CliRunner,
318+
temp_dir: str,
319+
project_details: ProjectDetails,
320+
uipath_json: UiPathJson,
321+
) -> None:
322+
"""Test generating operate.json and its content."""
323+
with runner.isolated_filesystem(temp_dir=temp_dir):
324+
with open("uipath.json", "w") as f:
325+
f.write(uipath_json.to_json())
326+
with open("pyproject.toml", "w") as f:
327+
f.write(project_details.to_toml())
328+
os.mkdir("subdir")
329+
with open("subdir/should_be_included.py", "w") as f:
330+
f.write("print(\"This file should be included in the .nupkg\")")
331+
result = runner.invoke(pack, ["./"])
332+
333+
assert result.exit_code == 0
334+
with zipfile.ZipFile(
335+
f".uipath/{project_details.name}.{project_details.version}.nupkg", "r"
336+
) as z:
337+
assert f"content/subdir/should_be_included.py" in z.namelist()
338+
315339
def test_successful_pack(
316340
self,
317341
runner: CliRunner,

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)