uipath 2.1.62__py3-none-any.whl → 2.1.64__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.
@@ -9,7 +9,11 @@ from urllib.parse import urlparse
9
9
  from uipath._cli._auth._auth_server import HTTPServer
10
10
  from uipath._cli._auth._client_credentials import ClientCredentialsService
11
11
  from uipath._cli._auth._oidc_utils import OidcUtils
12
- from uipath._cli._auth._portal_service import PortalService, select_tenant
12
+ from uipath._cli._auth._portal_service import (
13
+ PortalService,
14
+ get_tenant_id,
15
+ select_tenant,
16
+ )
13
17
  from uipath._cli._auth._url_utils import set_force_flag
14
18
  from uipath._cli._auth._utils import update_auth_file, update_env_file
15
19
  from uipath._cli._utils._console import ConsoleLogger
@@ -24,6 +28,7 @@ class AuthService:
24
28
  client_id: Optional[str],
25
29
  client_secret: Optional[str],
26
30
  base_url: Optional[str],
31
+ tenant: Optional[str],
27
32
  scope: Optional[str],
28
33
  ):
29
34
  self._force = force
@@ -32,6 +37,7 @@ class AuthService:
32
37
  self._client_id = client_id
33
38
  self._client_secret = client_secret
34
39
  self._base_url = base_url
40
+ self._tenant = tenant
35
41
  self._scope = scope
36
42
  set_force_flag(self._force)
37
43
 
@@ -108,7 +114,14 @@ class AuthService:
108
114
  update_env_file({"UIPATH_ACCESS_TOKEN": access_token})
109
115
 
110
116
  tenants_and_organizations = portal_service.get_tenants_and_organizations()
111
- base_url = select_tenant(self._domain, tenants_and_organizations)
117
+
118
+ if self._tenant:
119
+ base_url = get_tenant_id(
120
+ self._domain, self._tenant, tenants_and_organizations
121
+ )
122
+ else:
123
+ base_url = select_tenant(self._domain, tenants_and_organizations)
124
+
112
125
  try:
113
126
  portal_service.post_auth(base_url)
114
127
  except Exception:
@@ -231,3 +231,32 @@ def select_tenant(
231
231
  )
232
232
 
233
233
  return uipath_url
234
+
235
+
236
+ def get_tenant_id(
237
+ domain: str,
238
+ tenant_name: str,
239
+ tenants_and_organizations: TenantsAndOrganizationInfoResponse,
240
+ ) -> str:
241
+ tenants = tenants_and_organizations["tenants"]
242
+
243
+ matched_tenant = next((t for t in tenants if t["name"] == tenant_name), None)
244
+ if not matched_tenant:
245
+ console.error(f"Tenant '{tenant_name}' not found.")
246
+ raise ValueError(f"Tenant '{tenant_name}' not found.")
247
+
248
+ domain = get_base_url(domain)
249
+ account_name = tenants_and_organizations["organization"]["name"]
250
+
251
+ base_url = get_base_url(domain)
252
+ uipath_url = f"{base_url}/{account_name}/{tenant_name}"
253
+
254
+ update_env_file(
255
+ {
256
+ "UIPATH_URL": uipath_url,
257
+ "UIPATH_TENANT_ID": matched_tenant["id"],
258
+ "UIPATH_ORGANIZATION_ID": tenants_and_organizations["organization"]["id"],
259
+ }
260
+ )
261
+
262
+ return uipath_url
@@ -59,7 +59,9 @@ def gracefully_handle_errors(func):
59
59
  class StudioWebProgressReporter:
60
60
  """Handles reporting evaluation progress to StudioWeb."""
61
61
 
62
- def __init__(self):
62
+ def __init__(self, spans_exporter: LlmOpsHttpExporter):
63
+ self.spans_exporter = spans_exporter
64
+
63
65
  logging.getLogger("uipath._cli.middlewares").setLevel(logging.CRITICAL)
64
66
  console_logger = ConsoleLogger.get_instance()
65
67
  uipath = UiPath()
@@ -199,11 +201,11 @@ class StudioWebProgressReporter:
199
201
 
200
202
  async def handle_update_eval_run(self, payload: EvalRunUpdatedEvent) -> None:
201
203
  try:
202
- spans_exporter = LlmOpsHttpExporter(
203
- trace_id=self.eval_set_run_ids.get(payload.execution_id),
204
+ self.spans_exporter.trace_id = self.eval_set_run_ids.get(
205
+ payload.execution_id
204
206
  )
205
207
 
206
- spans_exporter.export(payload.spans)
208
+ self.spans_exporter.export(payload.spans)
207
209
 
208
210
  for eval_result in payload.eval_results:
209
211
  evaluator_id = eval_result.evaluator_id
@@ -330,6 +330,10 @@ def files_to_include(
330
330
  """
331
331
  file_extensions_included = [".py", ".mermaid", ".json", ".yaml", ".yml", ".md"]
332
332
  files_included = ["pyproject.toml"]
333
+ files_excluded = []
334
+
335
+ if directories_to_ignore is None:
336
+ directories_to_ignore = []
333
337
  if include_uv_lock:
334
338
  files_included += ["uv.lock"]
335
339
  if "settings" in config_data:
@@ -338,8 +342,10 @@ def files_to_include(
338
342
  file_extensions_included.extend(settings["fileExtensionsIncluded"])
339
343
  if "filesIncluded" in settings:
340
344
  files_included.extend(settings["filesIncluded"])
341
- if directories_to_ignore is None:
342
- directories_to_ignore = []
345
+ if "filesExcluded" in settings:
346
+ files_excluded.extend(settings["filesExcluded"])
347
+ if "directoriesExcluded" in settings:
348
+ directories_to_ignore.extend(settings["directoriesExcluded"])
343
349
 
344
350
  def is_venv_dir(d: str) -> bool:
345
351
  """Check if a directory is a Python virtual environment.
@@ -359,20 +365,63 @@ def files_to_include(
359
365
  extra_files: list[FileInfo] = []
360
366
  # Walk through directory and return all files in the allowlist
361
367
  for root, dirs, files in os.walk(directory):
362
- # Skip all directories that start with . or are a venv
363
- dirs[:] = [
364
- d
365
- for d in dirs
366
- if not d.startswith(".")
367
- and not is_venv_dir(os.path.join(root, d))
368
- and (directories_to_ignore is not None and d not in directories_to_ignore)
369
- ]
368
+ # Skip all directories that start with . or are a venv or are excluded
369
+ included_dirs = []
370
+ for d in dirs:
371
+ if d.startswith(".") or is_venv_dir(os.path.join(root, d)):
372
+ continue
373
+
374
+ # Check if directory should be excluded
375
+ dir_path = os.path.join(root, d)
376
+ dir_rel_path = os.path.relpath(dir_path, directory)
377
+ normalized_dir_rel_path = dir_rel_path.replace(os.sep, "/")
378
+
379
+ # Check exclusion: by dirname (for root level) or by relative path
380
+ should_exclude_dir = (
381
+ (
382
+ (
383
+ d in directories_to_ignore and normalized_dir_rel_path == d
384
+ ) # name match for root level only
385
+ or normalized_dir_rel_path
386
+ in directories_to_ignore # path match for nested directories
387
+ )
388
+ if directories_to_ignore is not None
389
+ else False
390
+ )
391
+
392
+ if not should_exclude_dir:
393
+ included_dirs.append(d)
394
+
395
+ dirs[:] = included_dirs
370
396
  for file in files:
371
397
  file_extension = os.path.splitext(file)[1].lower()
372
- if file_extension in file_extensions_included or file in files_included:
373
- file_path = os.path.join(root, file)
374
- file_name = os.path.basename(file_path)
375
- rel_path = os.path.relpath(file_path, directory)
398
+ file_path = os.path.join(root, file)
399
+ file_name = os.path.basename(file_path)
400
+ rel_path = os.path.relpath(file_path, directory)
401
+
402
+ # Normalize the path
403
+ normalized_rel_path = rel_path.replace(os.sep, "/")
404
+
405
+ # Check inclusion: by extension, by filename (for base directory), or by relative path
406
+ should_include = (
407
+ file_extension in file_extensions_included
408
+ or (
409
+ file in files_included and normalized_rel_path == file
410
+ ) # filename match for base directory only
411
+ or normalized_rel_path
412
+ in files_included # path match for subdirectories
413
+ )
414
+
415
+ # Check exclusion: by filename (for base directory only) or by relative path
416
+ should_exclude = (
417
+ (
418
+ file in files_excluded and normalized_rel_path == file
419
+ ) # filename match for base directory only
420
+ or normalized_rel_path
421
+ in files_excluded # path match for subdirectories
422
+ )
423
+
424
+ if should_include and not should_exclude:
376
425
  extra_files.append(
377
426
  FileInfo(
378
427
  file_name=file_name,
uipath/_cli/cli_auth.py CHANGED
@@ -35,6 +35,11 @@ console = ConsoleLogger()
35
35
  required=False,
36
36
  help="Base URL for the UiPath tenant instance (required for client credentials)",
37
37
  )
38
+ @click.option(
39
+ "--tenant",
40
+ required=False,
41
+ help="Tenant name within UiPath Automation Cloud",
42
+ )
38
43
  @click.option(
39
44
  "--scope",
40
45
  required=False,
@@ -48,6 +53,7 @@ def auth(
48
53
  client_id: Optional[str] = None,
49
54
  client_secret: Optional[str] = None,
50
55
  base_url: Optional[str] = None,
56
+ tenant: Optional[str] = None,
51
57
  scope: Optional[str] = None,
52
58
  ):
53
59
  """Authenticate with UiPath Cloud Platform.
@@ -69,6 +75,7 @@ def auth(
69
75
  client_id=client_id,
70
76
  client_secret=client_secret,
71
77
  base_url=base_url,
78
+ tenant=tenant,
72
79
  scope=scope,
73
80
  )
74
81
  with console.spinner("Authenticating with UiPath ..."):
uipath/_cli/cli_eval.py CHANGED
@@ -101,7 +101,7 @@ def eval(
101
101
  event_bus = EventBus()
102
102
 
103
103
  if not no_report:
104
- progress_reporter = StudioWebProgressReporter()
104
+ progress_reporter = StudioWebProgressReporter(LlmOpsHttpExporter())
105
105
  asyncio.run(progress_reporter.subscribe_to_eval_runtime_events(event_bus))
106
106
 
107
107
  def generate_runtime_context(**context_kwargs) -> UiPathRuntimeContext:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath
3
- Version: 2.1.62
3
+ Version: 2.1.64
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
@@ -6,10 +6,10 @@ uipath/_uipath.py,sha256=p2ccvWpzBXAGFSSF_YaaSWdEqzMmRt786d0pFWrCEwU,4463
6
6
  uipath/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  uipath/_cli/README.md,sha256=GLtCfbeIKZKNnGTCsfSVqRQ27V1btT1i2bSAyW_xZl4,474
8
8
  uipath/_cli/__init__.py,sha256=tscKceSouYcEOxUbGjoyHi4qGi74giBFeXG1I-ut1hs,2308
9
- uipath/_cli/cli_auth.py,sha256=i3ykLlCg68xgPXHHaa0agHwGFIiLiTLzOiF6Su8XaEo,2436
9
+ uipath/_cli/cli_auth.py,sha256=ZEA0Fwoo77Ez9ctpRAIq7sbAwj8F4OouAbMp1g1OvjM,2601
10
10
  uipath/_cli/cli_deploy.py,sha256=KPCmQ0c_NYD5JofSDao5r6QYxHshVCRxlWDVnQvlp5w,645
11
11
  uipath/_cli/cli_dev.py,sha256=nEfpjw1PZ72O6jmufYWVrueVwihFxDPOeJakdvNHdOA,2146
12
- uipath/_cli/cli_eval.py,sha256=MERBnZE4R6OxIXllx9lcl4qqtuAhw7l-XY5u-jdXkN4,4796
12
+ uipath/_cli/cli_eval.py,sha256=DK7FBLrNiBVEZgNBarlgjO065hsmQYLas-1e7nfIjLk,4816
13
13
  uipath/_cli/cli_init.py,sha256=Ac3-9tIH3rpikIX1ehWTo7InW5tjVNoz_w6fjvgLK4w,7052
14
14
  uipath/_cli/cli_invoke.py,sha256=m-te-EjhDpk_fhFDkt-yQFzmjEHGo5lQDGEQWxSXisQ,4395
15
15
  uipath/_cli/cli_new.py,sha256=9378NYUBc9j-qKVXV7oja-jahfJhXBg8zKVyaon7ctY,2102
@@ -21,11 +21,11 @@ uipath/_cli/cli_run.py,sha256=1FKv20EjxrrP1I5rNSnL_HzbWtOAIMjB3M--4RPA_Yo,3709
21
21
  uipath/_cli/middlewares.py,sha256=GvMhDnx1BmA7rIe12s6Uqv1JdqNZhvraU0a91oqGag4,4976
22
22
  uipath/_cli/spinner.py,sha256=bS-U_HA5yne11ejUERu7CQoXmWdabUD2bm62EfEdV8M,1107
23
23
  uipath/_cli/_auth/_auth_server.py,sha256=22km0F1NFNXgyLbvtAx3ssiQlVGHroLdtDCWEqiCiMg,7106
24
- uipath/_cli/_auth/_auth_service.py,sha256=tX8YuHlgUn2qUDQ_hrbabs7kMTD3K1u3EgqGYj92KRM,6106
24
+ uipath/_cli/_auth/_auth_service.py,sha256=Thtp2wXZQAHqossPPXuP6sAEe4Px9xThhZutMECRrdU,6386
25
25
  uipath/_cli/_auth/_client_credentials.py,sha256=VIyzgnGHSZxJXG8kSFIcCH0n2K2zep2SYcb5q1nBFcs,5408
26
26
  uipath/_cli/_auth/_models.py,sha256=sYMCfvmprIqnZxStlD_Dxx2bcxgn0Ri4D7uwemwkcNg,948
27
27
  uipath/_cli/_auth/_oidc_utils.py,sha256=j9VCXai_dM9PF1WtoWEsXETvrWUjuTgU-dCJ3oRudyg,2394
28
- uipath/_cli/_auth/_portal_service.py,sha256=MwsqEs505kMCiPCfjcelgflzvg1V3MqRNNVaOismaDc,8272
28
+ uipath/_cli/_auth/_portal_service.py,sha256=vP82BhjA2D6E6y2wDcXqO1cM4thhPl6DeGsnNXCBdhA,9144
29
29
  uipath/_cli/_auth/_url_utils.py,sha256=Vr-eYbwW_ltmwkULNEAbn6LNsMHnT4uT1n_1zlqD4Ss,1503
30
30
  uipath/_cli/_auth/_utils.py,sha256=9nb76xe5XmDZ0TAncp-_1SKqL6FdwRi9eS3C2noN1lY,1591
31
31
  uipath/_cli/_auth/auth_config.json,sha256=UnAhdum8phjuZaZKE5KLp0IcPCbIltDEU1M_G8gVbos,443
@@ -45,7 +45,7 @@ uipath/_cli/_dev/_terminal/_utils/_chat.py,sha256=YUZxYVdmEManwHDuZsczJT1dWIYE1d
45
45
  uipath/_cli/_dev/_terminal/_utils/_exporter.py,sha256=oI6D_eMwrh_2aqDYUh4GrJg8VLGrLYhDahR-_o0uJns,4144
46
46
  uipath/_cli/_dev/_terminal/_utils/_logger.py,sha256=jeNShEED27cNIHTe_NNx-2kUiXpSLTmi0onM6tVkqRM,888
47
47
  uipath/_cli/_evals/_evaluator_factory.py,sha256=2lOalabNSzmnnwr0SfoPWvFWXs0Ly857XBmPuOdhFBQ,4729
48
- uipath/_cli/_evals/_progress_reporter.py,sha256=Z-OEvZDixpHRdprKj0ukVe39RDMuzPzDhni-ygvUim4,16384
48
+ uipath/_cli/_evals/_progress_reporter.py,sha256=hpSt0CXpIoFJGsbqZkqmwyGO_TBNesbWKlvDJUEDxd8,16455
49
49
  uipath/_cli/_evals/_runtime.py,sha256=n14A1gTFtZekcdpswB_plpbaB81Q44_mvHqXQEqrB8o,11347
50
50
  uipath/_cli/_evals/_models/_evaluation_set.py,sha256=mwcTstHuyHd7ys_nLzgCNKBAsS4ns9UL2TF5Oq2Cc64,1758
51
51
  uipath/_cli/_evals/_models/_evaluator_base_params.py,sha256=lTYKOV66tcjW85KHTyOdtF1p1VDaBNemrMAvH8bFIFc,382
@@ -72,7 +72,7 @@ uipath/_cli/_utils/_folders.py,sha256=RsYrXzF0NA1sPxgBoLkLlUY3jDNLg1V-Y8j71Q8a8H
72
72
  uipath/_cli/_utils/_input_args.py,sha256=3LGNqVpJItvof75VGm-ZNTUMUH9-c7-YgleM5b2YgRg,5088
73
73
  uipath/_cli/_utils/_parse_ast.py,sha256=8Iohz58s6bYQ7rgWtOTjrEInLJ-ETikmOMZzZdIY2Co,20072
74
74
  uipath/_cli/_utils/_processes.py,sha256=q7DfEKHISDWf3pngci5za_z0Pbnf_shWiYEcTOTCiyk,1855
75
- uipath/_cli/_utils/_project_files.py,sha256=sulh3xZhDDw_rBOrn_XSUfVSD6sUu47ZK4n_lF5BKkQ,13197
75
+ uipath/_cli/_utils/_project_files.py,sha256=62VwZrroeKjlnqMqYSy3Aex11n9qYb7J8n3a8IVdo3I,15156
76
76
  uipath/_cli/_utils/_studio_project.py,sha256=hmWn9i7COkms3wAy5Di04ENF9KZAwbn_lyyTGDyq9uU,15571
77
77
  uipath/_cli/_utils/_tracing.py,sha256=2igb03j3EHjF_A406UhtCKkPfudVfFPjUq5tXUEG4oo,1541
78
78
  uipath/_cli/_utils/_uv_helpers.py,sha256=6SvoLnZPoKIxW0sjMvD1-ENV_HOXDYzH34GjBqwT138,3450
@@ -155,8 +155,8 @@ uipath/tracing/_traced.py,sha256=yBIY05PCCrYyx50EIHZnwJaKNdHPNx-YTR1sHQl0a98,199
155
155
  uipath/tracing/_utils.py,sha256=qd7N56tg6VXQ9pREh61esBgUWLNA0ssKsE0QlwrRWFM,11974
156
156
  uipath/utils/__init__.py,sha256=VD-KXFpF_oWexFg6zyiWMkxl2HM4hYJMIUDZ1UEtGx0,105
157
157
  uipath/utils/_endpoints_manager.py,sha256=iRTl5Q0XAm_YgcnMcJOXtj-8052sr6jpWuPNz6CgT0Q,8408
158
- uipath-2.1.62.dist-info/METADATA,sha256=s24g06f9pTc7KB-n0ewrZFNeRIHQiX6-7Po5W9Mffo0,6482
159
- uipath-2.1.62.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
160
- uipath-2.1.62.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
161
- uipath-2.1.62.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
162
- uipath-2.1.62.dist-info/RECORD,,
158
+ uipath-2.1.64.dist-info/METADATA,sha256=NZeKdp9gZ94W1RuEz7Ux5tfq-8lNvf2LdwIiRmSxo9w,6482
159
+ uipath-2.1.64.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
160
+ uipath-2.1.64.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
161
+ uipath-2.1.64.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
162
+ uipath-2.1.64.dist-info/RECORD,,