uipath 2.0.84__py3-none-any.whl → 2.1.1__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.
- uipath/_cli/_runtime/_contracts.py +20 -0
- uipath/_cli/_utils/_debug.py +4 -0
- uipath/_cli/cli_run.py +30 -8
- {uipath-2.0.84.dist-info → uipath-2.1.1.dist-info}/METADATA +1 -3
- {uipath-2.0.84.dist-info → uipath-2.1.1.dist-info}/RECORD +8 -8
- {uipath-2.0.84.dist-info → uipath-2.1.1.dist-info}/WHEEL +0 -0
- {uipath-2.0.84.dist-info → uipath-2.1.1.dist-info}/entry_points.txt +0 -0
- {uipath-2.0.84.dist-info → uipath-2.1.1.dist-info}/licenses/LICENSE +0 -0
@@ -148,6 +148,7 @@ class UiPathRuntimeContext(BaseModel):
|
|
148
148
|
trace_context: Optional[UiPathTraceContext] = None
|
149
149
|
tracing_enabled: Union[bool, str] = False
|
150
150
|
resume: bool = False
|
151
|
+
debug: bool = False
|
151
152
|
config_path: str = "uipath.json"
|
152
153
|
runtime_dir: Optional[str] = "__uipath"
|
153
154
|
logs_file: Optional[str] = "execution.log"
|
@@ -155,6 +156,8 @@ class UiPathRuntimeContext(BaseModel):
|
|
155
156
|
output_file: str = "output.json"
|
156
157
|
state_file: str = "state.db"
|
157
158
|
result: Optional[UiPathRuntimeResult] = None
|
159
|
+
execution_output_file: Optional[str] = None
|
160
|
+
input_file: Optional[str] = None
|
158
161
|
|
159
162
|
model_config = {"arbitrary_types_allowed": True}
|
160
163
|
|
@@ -295,6 +298,18 @@ class UiPathBaseRuntime(ABC):
|
|
295
298
|
Returns:
|
296
299
|
The runtime instance
|
297
300
|
"""
|
301
|
+
# Read the input from file if provided
|
302
|
+
if self.context.input_file:
|
303
|
+
_, file_extension = os.path.splitext(self.context.input_file)
|
304
|
+
if file_extension != ".json":
|
305
|
+
raise UiPathRuntimeError(
|
306
|
+
code="INVALID_INPUT_FILE_EXTENSION",
|
307
|
+
title="Invalid Input File Extension",
|
308
|
+
detail="The provided input file must be in JSON format.",
|
309
|
+
)
|
310
|
+
with open(self.context.input_file) as f:
|
311
|
+
self.context.input = f.read()
|
312
|
+
|
298
313
|
# Intercept all stdout/stderr/logs and write them to a file (runtime), stdout (debug)
|
299
314
|
self.logs_interceptor = LogsInterceptor(
|
300
315
|
min_level=self.context.logs_min_level,
|
@@ -370,6 +385,11 @@ class UiPathBaseRuntime(ABC):
|
|
370
385
|
with open(self.output_file_path, "w") as f:
|
371
386
|
json.dump(content, f, indent=2, default=str)
|
372
387
|
|
388
|
+
# Write the execution output to file if requested
|
389
|
+
if self.context.execution_output_file:
|
390
|
+
with open(self.context.execution_output_file, "w") as f:
|
391
|
+
json.dump(execution_result.output or {}, f, indent=2, default=str)
|
392
|
+
|
373
393
|
# Don't suppress exceptions
|
374
394
|
return False
|
375
395
|
|
uipath/_cli/_utils/_debug.py
CHANGED
@@ -42,6 +42,10 @@ def setup_debugging(debug: bool, debug_port: int = 5678) -> bool:
|
|
42
42
|
console.info(f"🐛 Debug server started on port {debug_port}")
|
43
43
|
console.info("📌 Waiting for debugger to attach...")
|
44
44
|
console.info(" - VS Code: Run -> Start Debugging -> Python: Remote Attach")
|
45
|
+
console.link(
|
46
|
+
" CLI Documentation reference: ",
|
47
|
+
"https://uipath.github.io/uipath-python/cli/#run",
|
48
|
+
)
|
45
49
|
|
46
50
|
debugpy.wait_for_client()
|
47
51
|
console.success("Debugger attached successfully!")
|
uipath/_cli/cli_run.py
CHANGED
@@ -32,6 +32,7 @@ def python_run_middleware(
|
|
32
32
|
entrypoint: Optional[str],
|
33
33
|
input: Optional[str],
|
34
34
|
resume: bool,
|
35
|
+
**kwargs,
|
35
36
|
) -> MiddlewareResult:
|
36
37
|
"""Middleware to handle Python script execution.
|
37
38
|
|
@@ -70,6 +71,8 @@ Usage: `uipath run <entrypoint_path> <input_arguments> [-f <input_json_file_path
|
|
70
71
|
context.resume = resume
|
71
72
|
context.job_id = env.get("UIPATH_JOB_KEY")
|
72
73
|
context.trace_id = env.get("UIPATH_TRACE_ID")
|
74
|
+
context.input_file = kwargs.get("input_file", None)
|
75
|
+
context.execution_output_file = kwargs.get("execution_output_file", None)
|
73
76
|
context.tracing_enabled = env.get("UIPATH_TRACING_ENABLED", True)
|
74
77
|
context.trace_context = UiPathTraceContext(
|
75
78
|
trace_id=env.get("UIPATH_TRACE_ID"),
|
@@ -118,6 +121,18 @@ Usage: `uipath run <entrypoint_path> <input_arguments> [-f <input_json_file_path
|
|
118
121
|
type=click.Path(exists=True),
|
119
122
|
help="File path for the .json input",
|
120
123
|
)
|
124
|
+
@click.option(
|
125
|
+
"--input-file",
|
126
|
+
required=False,
|
127
|
+
type=click.Path(exists=True),
|
128
|
+
help="Alias for '-f/--file' arguments",
|
129
|
+
)
|
130
|
+
@click.option(
|
131
|
+
"--output-file",
|
132
|
+
required=False,
|
133
|
+
type=click.Path(exists=False),
|
134
|
+
help="File path where the output will be written",
|
135
|
+
)
|
121
136
|
@click.option(
|
122
137
|
"--debug",
|
123
138
|
is_flag=True,
|
@@ -135,29 +150,36 @@ def run(
|
|
135
150
|
input: Optional[str],
|
136
151
|
resume: bool,
|
137
152
|
file: Optional[str],
|
153
|
+
input_file: Optional[str],
|
154
|
+
output_file: Optional[str],
|
138
155
|
debug: bool,
|
139
156
|
debug_port: int,
|
140
157
|
) -> None:
|
141
158
|
"""Execute the project."""
|
142
|
-
|
143
|
-
_, file_extension = os.path.splitext(file)
|
144
|
-
if file_extension != ".json":
|
145
|
-
console.error("Input file extension must be '.json'.")
|
146
|
-
with open(file) as f:
|
147
|
-
input = f.read()
|
159
|
+
input_file = file or input_file
|
148
160
|
# Setup debugging if requested
|
149
|
-
|
150
161
|
if not setup_debugging(debug, debug_port):
|
151
162
|
console.error(f"Failed to start debug server on port {debug_port}")
|
152
163
|
|
153
164
|
# Process through middleware chain
|
154
|
-
result = Middlewares.next(
|
165
|
+
result = Middlewares.next(
|
166
|
+
"run",
|
167
|
+
entrypoint,
|
168
|
+
input,
|
169
|
+
resume,
|
170
|
+
debug=debug,
|
171
|
+
debug_port=debug_port,
|
172
|
+
input_file=input_file,
|
173
|
+
execution_output_file=output_file,
|
174
|
+
)
|
155
175
|
|
156
176
|
if result.should_continue:
|
157
177
|
result = python_run_middleware(
|
158
178
|
entrypoint=entrypoint,
|
159
179
|
input=input,
|
160
180
|
resume=resume,
|
181
|
+
input_file=input_file,
|
182
|
+
execution_output_file=output_file,
|
161
183
|
)
|
162
184
|
|
163
185
|
# Handle result from middleware
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: uipath
|
3
|
-
Version: 2.
|
3
|
+
Version: 2.1.1
|
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
|
@@ -25,8 +25,6 @@ Requires-Dist: rich>=13.0.0
|
|
25
25
|
Requires-Dist: tenacity>=9.0.0
|
26
26
|
Requires-Dist: tomli>=2.2.1
|
27
27
|
Requires-Dist: truststore>=0.10.1
|
28
|
-
Provides-Extra: langchain
|
29
|
-
Requires-Dist: uipath-langchain<0.1.0,>=0.0.88; extra == 'langchain'
|
30
28
|
Description-Content-Type: text/markdown
|
31
29
|
|
32
30
|
# UiPath Python SDK
|
@@ -13,7 +13,7 @@ uipath/_cli/cli_invoke.py,sha256=FurosrZNGlmANIrplKWhw3EQ1b46ph5Z2rPwVaYJgmc,400
|
|
13
13
|
uipath/_cli/cli_new.py,sha256=9378NYUBc9j-qKVXV7oja-jahfJhXBg8zKVyaon7ctY,2102
|
14
14
|
uipath/_cli/cli_pack.py,sha256=P7tX3CJg2fzoLhPMHbr6m1fKXWRv2QkyIGgNM1MajT0,20978
|
15
15
|
uipath/_cli/cli_publish.py,sha256=QT17JTClAyLve6ZjB-WvQaJ-j4DdmNneV_eDRyXjeeQ,6578
|
16
|
-
uipath/_cli/cli_run.py,sha256=
|
16
|
+
uipath/_cli/cli_run.py,sha256=cTZYWJkGk2ruk6RRJBXII9J6VjpgGmysv_KlKI1JMHo,6446
|
17
17
|
uipath/_cli/middlewares.py,sha256=f7bVODO9tgdtWNepG5L58-B-VgBSU6Ek2tIU6wLz0xA,4905
|
18
18
|
uipath/_cli/spinner.py,sha256=bS-U_HA5yne11ejUERu7CQoXmWdabUD2bm62EfEdV8M,1107
|
19
19
|
uipath/_cli/_auth/_auth_server.py,sha256=p93_EvJpdoLLkiVmLygHRKo9ru1-PZOEAaEhNFN3j6c,6424
|
@@ -26,7 +26,7 @@ uipath/_cli/_auth/auth_config.json,sha256=xwh6paXwW3TDIsz2UHP_q3TxmBW-njFXh1q4Nd
|
|
26
26
|
uipath/_cli/_auth/index.html,sha256=ML_xDOcKs0ETYucufJskiYfWSvdrD_E26C0Qd3qpGj8,6280
|
27
27
|
uipath/_cli/_auth/localhost.crt,sha256=oGl9oLLOiouHubAt39B4zEfylFvKEtbtr_43SIliXJc,1226
|
28
28
|
uipath/_cli/_auth/localhost.key,sha256=X31VYXD8scZtmGA837dGX5l6G-LXHLo5ItWJhZXaz3c,1679
|
29
|
-
uipath/_cli/_runtime/_contracts.py,sha256=
|
29
|
+
uipath/_cli/_runtime/_contracts.py,sha256=j81Ou6Xz24K2UwEsxU-efvd775xKnZt08Rit94VZEYg,15251
|
30
30
|
uipath/_cli/_runtime/_escalation.py,sha256=x3vI98qsfRA-fL_tNkRVTFXioM5Gv2w0GFcXJJ5eQtg,7981
|
31
31
|
uipath/_cli/_runtime/_hitl.py,sha256=aexwe0dIXvh6SlVS1jVnO_aGZc6e3gLsmGkCyha5AHo,11300
|
32
32
|
uipath/_cli/_runtime/_logging.py,sha256=lA2LsakOrcSLnJWgo80-BYzIQBUWfqzzJGI1M61Gu0s,7874
|
@@ -39,7 +39,7 @@ uipath/_cli/_templates/package.nuspec.template,sha256=YZyLc-u_EsmIoKf42JsLQ55OGe
|
|
39
39
|
uipath/_cli/_utils/_common.py,sha256=wQ0a_lGj0bsuNvwxUfnLwg6T3IdatdfkrPcZMoufJNU,2058
|
40
40
|
uipath/_cli/_utils/_console.py,sha256=rj4V3yeR1wnJzFTHnaE6wcY9OoJV-PiIQnLg_p62ClQ,6664
|
41
41
|
uipath/_cli/_utils/_constants.py,sha256=9mRv_ZQoEPfvtTMipraQmYMJeCxcaLL7w8cYy4gJoQE,1225
|
42
|
-
uipath/_cli/_utils/_debug.py,sha256=
|
42
|
+
uipath/_cli/_utils/_debug.py,sha256=zamzIR4VgbdKADAE4gbmjxDsbgF7wvdr7C5Dqp744Oc,1739
|
43
43
|
uipath/_cli/_utils/_folders.py,sha256=UVJcKPfPAVR5HF4AP6EXdlNVcfEF1v5pwGCpoAgBY34,1155
|
44
44
|
uipath/_cli/_utils/_input_args.py,sha256=pyQhEcQXHdFHYTVNzvfWp439aii5StojoptnmCv5lfs,4094
|
45
45
|
uipath/_cli/_utils/_parse_ast.py,sha256=A-QToBIf-oP7yP2DQTHO6blkk6ik5z_IeaIwtEWO4e0,19516
|
@@ -95,8 +95,8 @@ uipath/tracing/_traced.py,sha256=qeVDrds2OUnpdUIA0RhtF0kg2dlAZhyC1RRkI-qivTM,185
|
|
95
95
|
uipath/tracing/_utils.py,sha256=ZeensQexnw69jVcsVrGyED7mPlAU-L1agDGm6_1A3oc,10388
|
96
96
|
uipath/utils/__init__.py,sha256=VD-KXFpF_oWexFg6zyiWMkxl2HM4hYJMIUDZ1UEtGx0,105
|
97
97
|
uipath/utils/_endpoints_manager.py,sha256=hiGEu6vyfQJoeiiql6w21TNiG6tADUfXlVBimxPU1-Q,4160
|
98
|
-
uipath-2.
|
99
|
-
uipath-2.
|
100
|
-
uipath-2.
|
101
|
-
uipath-2.
|
102
|
-
uipath-2.
|
98
|
+
uipath-2.1.1.dist-info/METADATA,sha256=EABqoFhaZSUJwdjTHlq0nsidBA3V59LRMazKGOdRuSg,6366
|
99
|
+
uipath-2.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
100
|
+
uipath-2.1.1.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
|
101
|
+
uipath-2.1.1.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
|
102
|
+
uipath-2.1.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|