uipath 2.0.33__py3-none-any.whl → 2.0.35__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of uipath might be problematic. Click here for more details.

@@ -30,7 +30,7 @@ def get_release_info(
30
30
  return None, None
31
31
  except IndexError:
32
32
  console.error(
33
- "Error: No process found in your workspace. Please publish the process first."
33
+ f"Error: No process with name '{package_name}' found in your workspace. Please publish the process first."
34
34
  )
35
35
  return None, None
36
36
  else:
uipath/_cli/cli_init.py CHANGED
@@ -20,10 +20,9 @@ def generate_env_file(target_directory):
20
20
 
21
21
  if not os.path.exists(env_path):
22
22
  relative_path = os.path.relpath(env_path, target_directory)
23
+ with open(env_path, "w"):
24
+ pass
23
25
  console.success(f" Created '{relative_path}' file.")
24
- with open(env_path, "w") as f:
25
- f.write("UIPATH_ACCESS_TOKEN=YOUR_TOKEN_HERE\n")
26
- f.write("UIPATH_URL=https://cloud.uipath.com/ACCOUNT_NAME/TENANT_NAME\n")
27
26
 
28
27
 
29
28
  def get_user_script(directory: str, entrypoint: Optional[str] = None) -> Optional[str]:
uipath/_cli/cli_invoke.py CHANGED
@@ -43,7 +43,7 @@ def _read_project_name() -> str:
43
43
  @click.argument("entrypoint", required=False)
44
44
  @click.argument("input", required=False, default="{}")
45
45
  def invoke(entrypoint: Optional[str], input: Optional[str]) -> None:
46
- """Invoke a published agent."""
46
+ """Invoke an agent published in my workspace."""
47
47
  with console.spinner("Loading configuration ..."):
48
48
  current_path = os.getcwd()
49
49
  load_dotenv(os.path.join(current_path, ".env"), override=True)
uipath/_cli/cli_new.py CHANGED
@@ -68,9 +68,8 @@ def new(name: str):
68
68
  ctx = click.get_current_context()
69
69
  init_cmd = ctx.parent.command.get_command(ctx, "init")
70
70
  ctx.invoke(init_cmd)
71
- console.hint(
72
- """Run project: uipath run main.py '{"message": "Hello World!"}'"""
73
- )
71
+ run_command = """uipath run main.py '{"message": "Hello World!"}'"""
72
+ console.hint(f"""Run project: {click.style(run_command, fg="cyan")}""")
74
73
 
75
74
 
76
75
  if __name__ == "__main__":
uipath/_cli/cli_run.py CHANGED
@@ -1,6 +1,5 @@
1
1
  # type: ignore
2
2
  import asyncio
3
- import logging
4
3
  import os
5
4
  import traceback
6
5
  from os import environ as env
@@ -16,9 +15,10 @@ from ._runtime._contracts import (
16
15
  UiPathTraceContext,
17
16
  )
18
17
  from ._runtime._runtime import UiPathRuntime
18
+ from ._utils._console import ConsoleLogger
19
19
  from .middlewares import MiddlewareResult, Middlewares
20
20
 
21
- logger = logging.getLogger(__name__)
21
+ console = ConsoleLogger()
22
22
  load_dotenv()
23
23
 
24
24
 
@@ -39,14 +39,14 @@ def python_run_middleware(
39
39
  return MiddlewareResult(
40
40
  should_continue=False,
41
41
  info_message="""Error: No entrypoint specified. Please provide a path to a Python script.
42
- Usage: `uipath run <entrypoint_path> <input_arguments>`""",
42
+ Usage: `uipath run <entrypoint_path> <input_arguments> [-f <input_json_file_path>]`""",
43
43
  )
44
44
 
45
45
  if not os.path.exists(entrypoint):
46
46
  return MiddlewareResult(
47
47
  should_continue=False,
48
48
  error_message=f"""Error: Script not found at path {entrypoint}.
49
- Usage: `uipath run <entrypoint_path> <input_arguments>`""",
49
+ Usage: `uipath run <entrypoint_path> <input_arguments> [-f <input_json_file_path>]`""",
50
50
  )
51
51
 
52
52
  try:
@@ -74,7 +74,6 @@ Usage: `uipath run <entrypoint_path> <input_arguments>`""",
74
74
  reference_id=env.get("UIPATH_JOB_KEY") or str(uuid4()),
75
75
  )
76
76
  context.logs_min_level = env.get("LOG_LEVEL", "INFO")
77
-
78
77
  async with UiPathRuntime.from_context(context) as runtime:
79
78
  await runtime.execute()
80
79
 
@@ -91,7 +90,6 @@ Usage: `uipath run <entrypoint_path> <input_arguments>`""",
91
90
  )
92
91
  except Exception as e:
93
92
  # Handle unexpected errors
94
- logger.exception("Unexpected error in Python runtime middleware")
95
93
  return MiddlewareResult(
96
94
  should_continue=False,
97
95
  error_message=f"Error: Unexpected error occurred - {str(e)}",
@@ -103,8 +101,23 @@ Usage: `uipath run <entrypoint_path> <input_arguments>`""",
103
101
  @click.argument("entrypoint", required=False)
104
102
  @click.argument("input", required=False, default="{}")
105
103
  @click.option("--resume", is_flag=True, help="Resume execution from a previous state")
106
- def run(entrypoint: Optional[str], input: Optional[str], resume: bool) -> None:
104
+ @click.option(
105
+ "-f",
106
+ "--file",
107
+ required=False,
108
+ type=click.Path(exists=True),
109
+ help="File path for the .json input",
110
+ )
111
+ def run(
112
+ entrypoint: Optional[str], input: Optional[str], resume: bool, file: Optional[str]
113
+ ) -> None:
107
114
  """Execute the project."""
115
+ if file:
116
+ _, file_extension = os.path.splitext(file)
117
+ if file_extension != ".json":
118
+ console.error("Input file extension must be '.json'.")
119
+ with open(file) as f:
120
+ input = f.read()
108
121
  # Process through middleware chain
109
122
  result = Middlewares.next("run", entrypoint, input, resume)
110
123
 
@@ -115,18 +128,22 @@ def run(entrypoint: Optional[str], input: Optional[str], resume: bool) -> None:
115
128
 
116
129
  # Handle result from middleware
117
130
  if result.error_message:
118
- click.echo(result.error_message, err=True)
131
+ console.error(result.error_message, include_traceback=True)
119
132
  if result.should_include_stacktrace:
120
- click.echo(traceback.format_exc(), err=True)
133
+ console.error(traceback.format_exc())
121
134
  click.get_current_context().exit(1)
122
135
 
123
136
  if result.info_message:
124
- click.echo(result.info_message)
137
+ console.info(result.info_message)
125
138
 
126
139
  # If middleware chain completed but didn't handle the request
127
140
  if result.should_continue:
128
- click.echo("Error: Could not process the request with any available handler.")
129
- click.get_current_context().exit(1)
141
+ console.error(
142
+ "Error: Could not process the request with any available handler."
143
+ )
144
+
145
+ if not result.should_continue and not result.error_message:
146
+ console.success("Successful execution.")
130
147
 
131
148
 
132
149
  if __name__ == "__main__":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath
3
- Version: 2.0.33
3
+ Version: 2.0.35
4
4
  Summary: Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools.
5
5
  Project-URL: Homepage, https://uipath.com
6
6
  Project-URL: Repository, https://github.com/UiPath/uipath-python
@@ -8,12 +8,12 @@ uipath/_cli/README.md,sha256=GLtCfbeIKZKNnGTCsfSVqRQ27V1btT1i2bSAyW_xZl4,474
8
8
  uipath/_cli/__init__.py,sha256=vGz3vJHkUvgK9_lKdzqiwwHkge1TCALRiOzGGwyr-8E,1885
9
9
  uipath/_cli/cli_auth.py,sha256=O-hbaYxLXBPXgnjW2gGa1lbvmVh1ui2-U9BzrLUU708,3707
10
10
  uipath/_cli/cli_deploy.py,sha256=lnGwwhDDY6La0fj_-duqx9saGUvY2iNNW28rQCI3hsU,308
11
- uipath/_cli/cli_init.py,sha256=Hk4R7dxTkRkSdo4gbp6QSKXe2jVdR5PBSDVjxCt7TO0,3834
12
- uipath/_cli/cli_invoke.py,sha256=Fnoc5_4nWxac-FVxQL-Akrqd-yQb9BwLWSzR9p397Lw,3221
13
- uipath/_cli/cli_new.py,sha256=uBWt44ZnNrq6oMYjYm4cCipmat2GRkcJ-g8YP_yP9-0,2024
11
+ uipath/_cli/cli_init.py,sha256=qleaHOuXZyqQ001XXFX3m8W2y3pW-miwuvMBl6rHCa4,3699
12
+ uipath/_cli/cli_invoke.py,sha256=o0iNl_aWQqFaYV9YYpCpSJtpTxmqP5TqpZZ69dTCoog,3238
13
+ uipath/_cli/cli_new.py,sha256=dZGdyPDk16L17JdmDh_cY6MNSvf0CwNrrAQmzUo-eUw,2069
14
14
  uipath/_cli/cli_pack.py,sha256=FZr7P5WZvPkrP56fjn4dTONv76NuoEhVtQwzG3CxGQs,14667
15
15
  uipath/_cli/cli_publish.py,sha256=qhuYQq8kogUbCDd-x7_vV4Px8t-0UeAjm96lE7KQBHM,5679
16
- uipath/_cli/cli_run.py,sha256=BSVx4fLJnBgpqK1VoRbSvpA_o4N0IbxQCU3fNmyry8I,4577
16
+ uipath/_cli/cli_run.py,sha256=ke4UQiqzagv4ST60-mvcC7nh1dQMw_Z6GQ2hAbnspU0,5074
17
17
  uipath/_cli/middlewares.py,sha256=IiJgjsqrJVKSXx4RcIKHWoH-SqWqpHPbhzkQEybmAos,3937
18
18
  uipath/_cli/spinner.py,sha256=bS-U_HA5yne11ejUERu7CQoXmWdabUD2bm62EfEdV8M,1107
19
19
  uipath/_cli/_auth/_auth_server.py,sha256=GRdjXUcvZO2O2GecolFJ8uMv7_DUD_VXeBJpElqmtIQ,7034
@@ -38,7 +38,7 @@ uipath/_cli/_utils/_console.py,sha256=rj4V3yeR1wnJzFTHnaE6wcY9OoJV-PiIQnLg_p62Cl
38
38
  uipath/_cli/_utils/_folders.py,sha256=-JilzZ4DM-nvpRkgaKZyV_xm1vq_8Ul9hRgOJ2yJJ5w,916
39
39
  uipath/_cli/_utils/_input_args.py,sha256=pyQhEcQXHdFHYTVNzvfWp439aii5StojoptnmCv5lfs,4094
40
40
  uipath/_cli/_utils/_parse_ast.py,sha256=3XVjnhJNnSfjXlitct91VOtqSl0l-sqDpoWww28mMc0,20663
41
- uipath/_cli/_utils/_processes.py,sha256=3X03Zqgk3DasH4K9jkfIhb4pt6CJ1KgnrFta5FwEOes,1328
41
+ uipath/_cli/_utils/_processes.py,sha256=TOtmF5LW7hbSGy4j0LqUfK-iPtl_cWWKjLb0lkPc9vI,1356
42
42
  uipath/_services/__init__.py,sha256=VPbwLDsvN26nWZgvR-8_-tc3i0rk5doqjTJbSrK0nN4,818
43
43
  uipath/_services/_base_service.py,sha256=3YClCoZBkVQGNJZGy-4NTk-HGsGA61XtwVQFYv9mwWk,7955
44
44
  uipath/_services/actions_service.py,sha256=PQ6HGEfX1vRBkFsjP2ykBRc9xOIf7wVKJC7Dkhka3HM,15623
@@ -79,8 +79,8 @@ uipath/tracing/__init__.py,sha256=GimSzv6qkCOlHOG1WtjYKJsZqcXpA28IgoXfR33JhiA,13
79
79
  uipath/tracing/_otel_exporters.py,sha256=x0PDPmDKJcxashsuehVsSsqBCzRr6WsNFaq_3_HS5F0,3014
80
80
  uipath/tracing/_traced.py,sha256=GFxOp73jk0vGTN_H7YZOOsEl9rVLaEhXGztMiYKIA-8,16634
81
81
  uipath/tracing/_utils.py,sha256=5SwsTGpHkIouXBndw-u8eCLnN4p7LM8DsTCCuf2jJgs,10165
82
- uipath-2.0.33.dist-info/METADATA,sha256=a-Naq5cfMirA_LJr5Ew3f7G8LNaWNz3KEdRqziZBAi4,6303
83
- uipath-2.0.33.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
84
- uipath-2.0.33.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
85
- uipath-2.0.33.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
86
- uipath-2.0.33.dist-info/RECORD,,
82
+ uipath-2.0.35.dist-info/METADATA,sha256=eYjELs27kjHhg50HaE92krP3uJ0Rd5TiL46S6VfO4Ec,6303
83
+ uipath-2.0.35.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
84
+ uipath-2.0.35.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
85
+ uipath-2.0.35.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
86
+ uipath-2.0.35.dist-info/RECORD,,