uipath 2.0.70__py3-none-any.whl → 2.0.72__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.

uipath/_cli/cli_init.py CHANGED
@@ -3,7 +3,7 @@ import json
3
3
  import os
4
4
  import uuid
5
5
  from pathlib import Path
6
- from typing import Optional
6
+ from typing import Any, Dict, Optional
7
7
 
8
8
  import click
9
9
  from dotenv import load_dotenv
@@ -16,6 +16,8 @@ from .middlewares import Middlewares
16
16
 
17
17
  console = ConsoleLogger()
18
18
 
19
+ CONFIG_PATH = "uipath.json"
20
+
19
21
 
20
22
  def generate_env_file(target_directory):
21
23
  env_path = os.path.join(target_directory, ".env")
@@ -27,6 +29,26 @@ def generate_env_file(target_directory):
27
29
  console.success(f" Created '{relative_path}' file.")
28
30
 
29
31
 
32
+ def get_existing_settings(config_path: str) -> Optional[Dict[str, Any]]:
33
+ """Read existing settings from uipath.json if it exists.
34
+
35
+ Args:
36
+ config_path: Path to the uipath.json file.
37
+
38
+ Returns:
39
+ The settings dictionary if it exists, None otherwise.
40
+ """
41
+ if not os.path.exists(config_path):
42
+ return None
43
+
44
+ try:
45
+ with open(config_path, "r") as config_file:
46
+ existing_config = json.load(config_file)
47
+ return existing_config.get("settings")
48
+ except (json.JSONDecodeError, IOError):
49
+ return None
50
+
51
+
30
52
  def get_user_script(directory: str, entrypoint: Optional[str] = None) -> Optional[str]:
31
53
  """Find the Python script to process."""
32
54
  if entrypoint:
@@ -52,10 +74,28 @@ def get_user_script(directory: str, entrypoint: Optional[str] = None) -> Optiona
52
74
  return None
53
75
 
54
76
 
77
+ def write_config_file(config_data: Dict[str, Any]) -> None:
78
+ existing_settings = get_existing_settings(CONFIG_PATH)
79
+ if existing_settings is not None:
80
+ config_data["settings"] = existing_settings
81
+
82
+ with open(CONFIG_PATH, "w") as config_file:
83
+ json.dump(config_data, config_file, indent=4)
84
+
85
+ return CONFIG_PATH
86
+
87
+
55
88
  @click.command()
56
89
  @click.argument("entrypoint", required=False, default=None)
90
+ @click.option(
91
+ "--infer-bindings/--no-infer-bindings",
92
+ is_flag=True,
93
+ required=False,
94
+ default=True,
95
+ help="Infer bindings from the script.",
96
+ )
57
97
  @track
58
- def init(entrypoint: str) -> None:
98
+ def init(entrypoint: str, infer_bindings: bool) -> None:
59
99
  """Create uipath.json with input/output schemas and bindings."""
60
100
  current_path = os.getcwd()
61
101
  load_dotenv(os.path.join(current_path, ".env"), override=True)
@@ -64,7 +104,12 @@ def init(entrypoint: str) -> None:
64
104
  current_directory = os.getcwd()
65
105
  generate_env_file(current_directory)
66
106
 
67
- result = Middlewares.next("init", entrypoint)
107
+ result = Middlewares.next(
108
+ "init",
109
+ entrypoint,
110
+ options={"infer_bindings": infer_bindings},
111
+ write_config=write_config_file,
112
+ )
68
113
 
69
114
  if result.error_message:
70
115
  console.error(
@@ -102,16 +147,16 @@ def init(entrypoint: str) -> None:
102
147
 
103
148
  # Generate bindings JSON based on the script path
104
149
  try:
105
- bindings_data = generate_bindings_json(script_path)
150
+ if infer_bindings:
151
+ bindings_data = generate_bindings_json(script_path)
152
+ else:
153
+ bindings_data = {}
106
154
  # Add bindings to the config data
107
155
  config_data["bindings"] = bindings_data
108
156
  except Exception as e:
109
157
  console.warning(f"Warning: Could not generate bindings: {str(e)}")
110
158
 
111
- config_path = "uipath.json"
112
- with open(config_path, "w") as config_file:
113
- json.dump(config_data, config_file, indent=4)
114
-
159
+ config_path = write_config_file(config_data)
115
160
  console.success(f"Created '{config_path}' file.")
116
161
  except Exception as e:
117
162
  console.error(f"Error creating configuration file:\n {str(e)}")
uipath/_cli/cli_pack.py CHANGED
@@ -304,7 +304,7 @@ def pack_fn(projectName, description, entryPoints, version, authors, directory):
304
304
  with open(file_path, "r", encoding="latin-1") as f:
305
305
  z.writestr(f"content/{rel_path}", f.read())
306
306
 
307
- optional_files = ["pyproject.toml", "README.md"]
307
+ optional_files = ["pyproject.toml", "README.md", "uv.lock"]
308
308
  for file in optional_files:
309
309
  file_path = os.path.join(directory, file)
310
310
  if os.path.exists(file_path):
@@ -1,9 +1,13 @@
1
1
  import importlib.metadata
2
+ import inspect
2
3
  import logging
3
4
  from dataclasses import dataclass
4
5
  from typing import Any, Callable, Dict, List, Optional
5
6
 
7
+ from ._utils._console import ConsoleLogger
8
+
6
9
  logger = logging.getLogger(__name__)
10
+ console = ConsoleLogger()
7
11
 
8
12
 
9
13
  @dataclass
@@ -50,8 +54,30 @@ class Middlewares:
50
54
 
51
55
  middlewares = cls.get(command)
52
56
  for middleware in middlewares:
57
+ sig = inspect.signature(middleware)
58
+
59
+ # handle older versions of plugins that don't support the new signature
60
+ try:
61
+ bound = sig.bind(*args, **kwargs)
62
+ new_args = bound.args
63
+ new_kwargs = bound.kwargs
64
+ except TypeError:
65
+ console.warning("Install the latest version for uipath packages")
66
+ accepted_args = [
67
+ name
68
+ for name, param in sig.parameters.items()
69
+ if param.kind
70
+ in (param.POSITIONAL_ONLY, param.POSITIONAL_OR_KEYWORD)
71
+ ]
72
+
73
+ trimmed_args = args[: len(accepted_args)]
74
+ trimmed_kwargs = {k: v for k, v in kwargs.items() if k in accepted_args}
75
+
76
+ new_args = trimmed_args
77
+ new_kwargs = trimmed_kwargs
78
+
53
79
  try:
54
- result = middleware(*args, **kwargs)
80
+ result = middleware(*new_args, **new_kwargs)
55
81
  if not result.should_continue:
56
82
  logger.debug(
57
83
  f"Command '{command}' stopped by {middleware.__name__}"
@@ -1,4 +1,4 @@
1
- _CONNECTION_STRING = "InstrumentationKey=d3da6dfc-5231-4d72-9696-f680a64683b8;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=9b73b209-6c6a-4d4a-9549-b922cef418d5"
1
+ _CONNECTION_STRING = "InstrumentationKey=4128b5ed-f5ec-4612-ac32-b8cff0f2de93;IngestionEndpoint=https://northeurope-2.in.applicationinsights.azure.com/;LiveEndpoint=https://northeurope.livediagnostics.monitor.azure.com/;ApplicationId=f448014b-2abf-4681-8e48-583e33f7d173"
2
2
 
3
3
  _APP_INSIGHTS_EVENT_MARKER_ATTRIBUTE = "APPLICATION_INSIGHTS_EVENT_MARKER_ATTRIBUTE"
4
4
  _OTEL_RESOURCE_ATTRIBUTES = "OTEL_RESOURCE_ATTRIBUTES"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath
3
- Version: 2.0.70
3
+ Version: 2.0.72
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,13 +8,13 @@ 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=aIecyySuGXJEQHnS6b-M6sxM7ki5trjqq_J7s-sCdQE,3966
10
10
  uipath/_cli/cli_deploy.py,sha256=KPCmQ0c_NYD5JofSDao5r6QYxHshVCRxlWDVnQvlp5w,645
11
- uipath/_cli/cli_init.py,sha256=JM-0E15sxOLd1o4X2NaiN2FPRuA7XV2lwtCVS0s-v7E,3866
11
+ uipath/_cli/cli_init.py,sha256=SmB7VplpXRSa5sgqgzojNsZDw0zfsEi2TfkMx3eQpTo,5132
12
12
  uipath/_cli/cli_invoke.py,sha256=IjndcDWBpvAqGCRanQU1vfmxaBF8FhyZ7gWuZqwjHrU,3812
13
13
  uipath/_cli/cli_new.py,sha256=9378NYUBc9j-qKVXV7oja-jahfJhXBg8zKVyaon7ctY,2102
14
- uipath/_cli/cli_pack.py,sha256=-Otnb-oI--D7kkRir9P_-PygmHGdblO8JOPrZLm7DIk,15035
14
+ uipath/_cli/cli_pack.py,sha256=6W7AqVMjeXOe8cQ3GUoD32VMJNfhtvHut_7moJ6kJkI,15046
15
15
  uipath/_cli/cli_publish.py,sha256=Ba0TJ1TSfuQbLU2AIgtM8QWkLHgr4tsAP1CaX12113U,6010
16
16
  uipath/_cli/cli_run.py,sha256=zYg-9U6mkofdGsE0IGjYi1dOMlG8CdBxiVGxfFiLq5Y,5882
17
- uipath/_cli/middlewares.py,sha256=IiJgjsqrJVKSXx4RcIKHWoH-SqWqpHPbhzkQEybmAos,3937
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
20
20
  uipath/_cli/_auth/_models.py,sha256=sYMCfvmprIqnZxStlD_Dxx2bcxgn0Ri4D7uwemwkcNg,948
@@ -85,14 +85,14 @@ uipath/models/llm_gateway.py,sha256=0sl5Wtve94V14H3AHwmJSoXAhoc-Fai3wJxP8HrnBPg,
85
85
  uipath/models/processes.py,sha256=Atvfrt6X4TYST3iA62jpS_Uxc3hg6uah11p-RaKZ6dk,2029
86
86
  uipath/models/queues.py,sha256=N_s0GKucbyjh0RnO8SxPk6wlRgvq8KIIYsfaoIY46tM,6446
87
87
  uipath/telemetry/__init__.py,sha256=Wna32UFzZR66D-RzTKlPWlvji9i2HJb82NhHjCCXRjY,61
88
- uipath/telemetry/_constants.py,sha256=RVymOX07CRzcGMn1OWzh-TR6bZMvLG3vdCA6fvRrrCk,678
88
+ uipath/telemetry/_constants.py,sha256=z7taKsKM3CrMEa6gXBgK8otumT2dIXrw7WXc0XE9zYA,680
89
89
  uipath/telemetry/_track.py,sha256=v0e3hgwtetMsUco4yosBzNU00Ek5SI9RxUTumrTTNyo,3872
90
90
  uipath/tracing/__init__.py,sha256=GKRINyWdHVrDsI-8mrZDLdf0oey6GHGlNZTOADK-kgc,224
91
91
  uipath/tracing/_otel_exporters.py,sha256=x0PDPmDKJcxashsuehVsSsqBCzRr6WsNFaq_3_HS5F0,3014
92
92
  uipath/tracing/_traced.py,sha256=qeVDrds2OUnpdUIA0RhtF0kg2dlAZhyC1RRkI-qivTM,18528
93
93
  uipath/tracing/_utils.py,sha256=ZeensQexnw69jVcsVrGyED7mPlAU-L1agDGm6_1A3oc,10388
94
- uipath-2.0.70.dist-info/METADATA,sha256=lIJpyFWC5uV5aZkH5rVU8xKXpz_ZKauidMYQ5ZMZnBc,6304
95
- uipath-2.0.70.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
96
- uipath-2.0.70.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
97
- uipath-2.0.70.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
98
- uipath-2.0.70.dist-info/RECORD,,
94
+ uipath-2.0.72.dist-info/METADATA,sha256=8GLcdGovov-loJNQ-VP7rDOyPvQfiPh2BkU5-Tb8l9s,6304
95
+ uipath-2.0.72.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
96
+ uipath-2.0.72.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
97
+ uipath-2.0.72.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
98
+ uipath-2.0.72.dist-info/RECORD,,