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

@@ -7,25 +7,24 @@ import requests
7
7
  from dotenv import load_dotenv
8
8
 
9
9
  from ._utils._common import get_env_vars
10
+ from ._utils._console import ConsoleLogger
10
11
  from ._utils._folders import get_personal_workspace_info
11
12
  from ._utils._processes import get_release_info
12
- from .spinner import Spinner
13
+
14
+ console = ConsoleLogger()
13
15
 
14
16
 
15
17
  def get_most_recent_package():
16
18
  nupkg_files = [f for f in os.listdir(".uipath") if f.endswith(".nupkg")]
17
19
  if not nupkg_files:
18
- click.echo("No .nupkg file found in .uipath directory")
20
+ console.error("No .nupkg files found. Please run `uipath pack` first.")
19
21
  return
20
-
21
22
  # Get full path and modification time for each file
22
23
  nupkg_files_with_time = [
23
24
  (f, os.path.getmtime(os.path.join(".uipath", f))) for f in nupkg_files
24
25
  ]
25
-
26
26
  # Sort by modification time (most recent first)
27
27
  nupkg_files_with_time.sort(key=lambda x: x[1], reverse=True)
28
-
29
28
  # Get most recent file
30
29
  return nupkg_files_with_time[0][0]
31
30
 
@@ -36,23 +35,16 @@ def get_available_feeds(
36
35
  url = f"{base_url}/orchestrator_/api/PackageFeeds/GetFeeds"
37
36
  response = requests.get(url, headers=headers)
38
37
  if response.status_code != 200:
39
- click.echo(
40
- f"Failed to fetch available feeds. Status code: {response.status_code}"
38
+ console.error(
39
+ f"Failed to fetch available feeds. Please check your connection. Status code: {response.status_code} {response.text}"
41
40
  )
42
- if response.text:
43
- click.echo(response.text)
44
- click.get_current_context().exit(1)
45
41
  try:
46
42
  available_feeds = [
47
43
  feed for feed in response.json() if feed["purpose"] == "Processes"
48
44
  ]
49
45
  return [(feed["name"], feed["id"]) for feed in available_feeds]
50
46
  except Exception as e:
51
- click.echo(
52
- "❌ Failed to deserialize available feeds.",
53
- )
54
- click.echo(e)
55
- click.get_current_context().exit(1)
47
+ console.error(f"Failed to deserialize available feeds: {str(e)}")
56
48
 
57
49
 
58
50
  @click.command()
@@ -71,28 +63,30 @@ def get_available_feeds(
71
63
  help="Whether to publish to the personal workspace",
72
64
  )
73
65
  def publish(feed):
74
- spinner = Spinner()
66
+ """Publish the package."""
75
67
  current_path = os.getcwd()
76
68
  load_dotenv(os.path.join(current_path, ".env"), override=True)
69
+
77
70
  [base_url, token] = get_env_vars()
78
71
  headers = {"Authorization": f"Bearer {token}"}
72
+
79
73
  if feed is None:
80
- available_feeds = get_available_feeds(base_url, headers)
81
- click.echo("👇 Select package feed:")
82
- for idx, feed in enumerate(available_feeds, start=0):
83
- click.echo(f" {idx}: {feed[0]}")
84
- feed_idx = click.prompt("Select feed", type=int)
74
+ with console.spinner("Fetching available package feeds..."):
75
+ available_feeds = get_available_feeds(base_url, headers)
76
+ console.display_options(
77
+ [feed[0] for feed in available_feeds], "Select package feed:"
78
+ )
79
+ feed_idx = console.prompt("Select feed number", type=int)
85
80
  if feed_idx < 0:
86
- click.echo("Invalid input")
87
- click.get_current_context().exit(1)
81
+ console.error("Invalid feed selected")
88
82
  try:
89
83
  selected_feed = available_feeds[feed_idx]
90
84
  feed = selected_feed[1]
85
+ console.info(
86
+ f"Selected feed: {click.style(str(selected_feed[0]), fg='cyan')}"
87
+ )
91
88
  except IndexError:
92
- click.echo("Invalid feed selected")
93
- click.get_current_context().exit(1)
94
-
95
- click.echo(f"Selected feed: {click.style(str(selected_feed[0]), fg='cyan')}")
89
+ console.error("Invalid feed selected")
96
90
 
97
91
  os.makedirs(".uipath", exist_ok=True)
98
92
 
@@ -100,71 +94,59 @@ def publish(feed):
100
94
  most_recent = get_most_recent_package()
101
95
 
102
96
  if not most_recent:
103
- spinner.stop()
104
- click.echo("❌ Error: No package files found in .uipath directory")
105
- raise click.Abort()
97
+ console.error("No .nupkg files found. Please run `uipath pack` first.")
106
98
 
107
- spinner.start(f"Publishing most recent package: {most_recent}")
99
+ is_personal_workspace = False
108
100
 
109
- package_to_publish_path = os.path.join(".uipath", most_recent)
101
+ with console.spinner(f"Publishing most recent package: {most_recent} ..."):
102
+ package_to_publish_path = os.path.join(".uipath", most_recent)
103
+ url = f"{base_url}/orchestrator_/odata/Processes/UiPath.Server.Configuration.OData.UploadPackage()"
110
104
 
111
- url = f"{base_url}/orchestrator_/odata/Processes/UiPath.Server.Configuration.OData.UploadPackage()"
112
- is_personal_workspace = False
105
+ if feed and feed != "tenant":
106
+ # Check user personal workspace
107
+ personal_workspace_feed_id, personal_workspace_folder_id = (
108
+ get_personal_workspace_info(base_url, token)
109
+ )
110
+ if feed == "personal" or feed == personal_workspace_feed_id:
111
+ is_personal_workspace = True
112
+ if (
113
+ personal_workspace_feed_id is None
114
+ or personal_workspace_folder_id is None
115
+ ):
116
+ console.error(
117
+ "No personal workspace found for user. Please try reauthenticating."
118
+ )
119
+ url = url + "?feedId=" + personal_workspace_feed_id
120
+ else:
121
+ url = url + "?feedId=" + feed
113
122
 
114
- if feed and feed != "tenant":
115
- # Check user personal workspace
116
- personal_workspace_feed_id, personal_workspace_folder_id = (
117
- get_personal_workspace_info(base_url, token, spinner)
118
- )
119
- if feed == "personal" or feed == personal_workspace_feed_id:
120
- is_personal_workspace = True
121
- if (
122
- personal_workspace_feed_id is None
123
- or personal_workspace_folder_id is None
124
- ):
125
- spinner.stop()
126
- click.echo("❌ No personal workspace found for user")
127
- click.get_current_context().exit(1)
128
- url = url + "?feedId=" + personal_workspace_feed_id
129
- else:
130
- url = url + "?feedId=" + feed
131
-
132
- with open(package_to_publish_path, "rb") as f:
133
- files = {"file": (package_to_publish_path, f, "application/octet-stream")}
134
- response = requests.post(url, headers=headers, files=files)
135
-
136
- spinner.stop()
123
+ with open(package_to_publish_path, "rb") as f:
124
+ files = {"file": (package_to_publish_path, f, "application/octet-stream")}
125
+ response = requests.post(url, headers=headers, files=files)
137
126
 
138
127
  if response.status_code == 200:
139
- click.echo(
140
- click.style("✓ ", fg="green", bold=True) + "Package published successfully!"
141
- )
128
+ console.success("Package published successfully!")
129
+
142
130
  if is_personal_workspace:
143
131
  try:
144
132
  data = json.loads(response.text)
145
133
  package_name = json.loads(data["value"][0]["Body"])["Id"]
146
134
  except json.decoder.JSONDecodeError:
147
- click.echo("⚠️ Warning: Failed to deserialize package name")
148
- raise click.Abort() from json.decoder.JSONDecodeError
149
- release_id, _ = get_release_info(
150
- base_url, token, package_name, personal_workspace_feed_id, spinner
151
- )
152
- if release_id:
153
- process_url = f"{base_url}/orchestrator_/processes/{release_id}/edit?fid={personal_workspace_folder_id}"
154
- click.echo(
155
- "🔧 Configure your process: "
156
- + click.style(
157
- f"\u001b]8;;{process_url}\u001b\\{process_url}\u001b]8;;\u001b\\",
158
- fg="bright_blue",
159
- bold=True,
135
+ console.warning("Failed to deserialize package name")
136
+ if package_name is not None:
137
+ with console.spinner("Getting process information ..."):
138
+ release_id, _ = get_release_info(
139
+ base_url, token, package_name, personal_workspace_feed_id
160
140
  )
161
- )
162
- click.echo(
163
- "💡 Use the link above to configure any environment variables"
164
- )
165
- else:
166
- click.echo("⚠️ Warning: Failed to compose process url")
141
+ if release_id:
142
+ process_url = f"{base_url}/orchestrator_/processes/{release_id}/edit?fid={personal_workspace_folder_id}"
143
+ console.link("Process configuration link:", process_url)
144
+ console.hint(
145
+ "Use the link above to configure any environment variables"
146
+ )
147
+ else:
148
+ console.warning("Failed to compose process url")
167
149
  else:
168
- click.echo(f"❌ Failed to publish package. Status code: {response.status_code}")
169
- if response.text:
170
- click.echo(response.text)
150
+ console.error(
151
+ f"Failed to publish package. Status code: {response.status_code} {response.text}"
152
+ )
uipath/_cli/cli_run.py CHANGED
@@ -104,7 +104,7 @@ Usage: `uipath run <entrypoint_path> <input_arguments>`""",
104
104
  @click.argument("input", required=False, default="{}")
105
105
  @click.option("--resume", is_flag=True, help="Resume execution from a previous state")
106
106
  def run(entrypoint: Optional[str], input: Optional[str], resume: bool) -> None:
107
- """Execute a Python script with JSON input."""
107
+ """Execute the project."""
108
108
  # Process through middleware chain
109
109
  result = Middlewares.next("run", entrypoint, input, resume)
110
110
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath
3
- Version: 2.0.26
3
+ Version: 2.0.27
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,20 +6,20 @@ uipath/_uipath.py,sha256=D9UWyRInN2Q8HFEQtYaYzT3DCZ3tW_OCBs_4RRqRVuY,2795
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=vGz3vJHkUvgK9_lKdzqiwwHkge1TCALRiOzGGwyr-8E,1885
9
- uipath/_cli/cli_auth.py,sha256=y_F5Rm3Juxy5oKn0nyPtMidNf6awywOw9VCLUvnDrCc,3420
10
- uipath/_cli/cli_deploy.py,sha256=h8qwJkXnW6JURsg4YcocJInGA4dwkl4CZkpT1Cn9A3c,268
11
- uipath/_cli/cli_init.py,sha256=75wHT0A4LuZFjlBQ8F34958Aq_o_KJdOlTQfwvFUqo4,3916
12
- uipath/_cli/cli_invoke.py,sha256=Qp9ao4xDeXSlKtxXWNn1oHxOuEcFZN7v6TZl0LjaWYk,3170
13
- uipath/_cli/cli_new.py,sha256=ViGqmheiuH5KLKUs0ECtv-xuxH4HtMxfb8bV8D2673M,2183
14
- uipath/_cli/cli_pack.py,sha256=V5fm3XPJ_vtJ2lrLoQU_jDgAKVe9lsipeB6n_7Nc4WM,13955
15
- uipath/_cli/cli_publish.py,sha256=pJn-6oWfNvAo0P9powl9_hpQ57EeNgKB2q1tpzHtoSU,6037
16
- uipath/_cli/cli_run.py,sha256=B5L7fE2IqysIEcweedU8GEy7ekMGwpeRagYBCB_cdQI,4597
9
+ uipath/_cli/cli_auth.py,sha256=HYai-JU2uFDMYdLPdi75xKjAGQkcuqDZBwibXQwiM2s,3461
10
+ uipath/_cli/cli_deploy.py,sha256=lnGwwhDDY6La0fj_-duqx9saGUvY2iNNW28rQCI3hsU,308
11
+ uipath/_cli/cli_init.py,sha256=94lEeDKKhlfPerEIC7lWZdcTyauZ9q1gslwExj4SSG4,3826
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
14
+ uipath/_cli/cli_pack.py,sha256=FZr7P5WZvPkrP56fjn4dTONv76NuoEhVtQwzG3CxGQs,14667
15
+ uipath/_cli/cli_publish.py,sha256=qhuYQq8kogUbCDd-x7_vV4Px8t-0UeAjm96lE7KQBHM,5679
16
+ uipath/_cli/cli_run.py,sha256=BSVx4fLJnBgpqK1VoRbSvpA_o4N0IbxQCU3fNmyry8I,4577
17
17
  uipath/_cli/middlewares.py,sha256=IiJgjsqrJVKSXx4RcIKHWoH-SqWqpHPbhzkQEybmAos,3937
18
18
  uipath/_cli/spinner.py,sha256=bS-U_HA5yne11ejUERu7CQoXmWdabUD2bm62EfEdV8M,1107
19
- uipath/_cli/_auth/_auth_server.py,sha256=RAOk15KE6_3FzcLuSz1D_BArf2GJxvhJQ08x_VnL3k4,7100
19
+ uipath/_cli/_auth/_auth_server.py,sha256=GRdjXUcvZO2O2GecolFJ8uMv7_DUD_VXeBJpElqmtIQ,7034
20
20
  uipath/_cli/_auth/_models.py,sha256=sYMCfvmprIqnZxStlD_Dxx2bcxgn0Ri4D7uwemwkcNg,948
21
21
  uipath/_cli/_auth/_oidc_utils.py,sha256=WaX9jDlXrlX6yD8i8gsocV8ngjaT72Xd1tvsZMmSbco,2127
22
- uipath/_cli/_auth/_portal_service.py,sha256=YPL-_Z9oVK-VjQ67m31-t3y3uvNnPl_qubU-m4zlHMU,6042
22
+ uipath/_cli/_auth/_portal_service.py,sha256=7_UtCuyKPxPQu55TPRsG3ioMPfo_Fbx_1Ml-uJ-OP_w,6333
23
23
  uipath/_cli/_auth/_utils.py,sha256=9nb76xe5XmDZ0TAncp-_1SKqL6FdwRi9eS3C2noN1lY,1591
24
24
  uipath/_cli/_auth/auth_config.json,sha256=NTb_ZZor5xEgya2QbK51GiTL5_yVqG_QpV4VYIp8_mk,342
25
25
  uipath/_cli/_auth/index.html,sha256=ML_xDOcKs0ETYucufJskiYfWSvdrD_E26C0Qd3qpGj8,6280
@@ -34,10 +34,11 @@ uipath/_cli/_templates/[Content_Types].xml.template,sha256=bYsKDz31PkIF9QksjgAY_
34
34
  uipath/_cli/_templates/main.py.template,sha256=QB62qX5HKDbW4lFskxj7h9uuxBITnTWqu_DE6asCwcU,476
35
35
  uipath/_cli/_templates/package.nuspec.template,sha256=YZyLc-u_EsmIoKf42JsLQ55OGeFmb8VkIU2VF7DFbtw,359
36
36
  uipath/_cli/_utils/_common.py,sha256=h0-lvaAzz-4iM7WuEqZhlTo5QadBpsQyAdlggx73-PA,1123
37
- uipath/_cli/_utils/_folders.py,sha256=-A3dwz3ViPVzVuSii0PT2FZiELBIdPtzU-PYfrGdFuA,1014
37
+ uipath/_cli/_utils/_console.py,sha256=rj4V3yeR1wnJzFTHnaE6wcY9OoJV-PiIQnLg_p62ClQ,6664
38
+ uipath/_cli/_utils/_folders.py,sha256=-JilzZ4DM-nvpRkgaKZyV_xm1vq_8Ul9hRgOJ2yJJ5w,916
38
39
  uipath/_cli/_utils/_input_args.py,sha256=pyQhEcQXHdFHYTVNzvfWp439aii5StojoptnmCv5lfs,4094
39
40
  uipath/_cli/_utils/_parse_ast.py,sha256=3XVjnhJNnSfjXlitct91VOtqSl0l-sqDpoWww28mMc0,20663
40
- uipath/_cli/_utils/_processes.py,sha256=kcsMNlo8yvWwKSBxumAPFDPm67Od1ZpZglfNgvoIBso,1602
41
+ uipath/_cli/_utils/_processes.py,sha256=3EPrGqIFWohnbIZ9xLylgWRRHaYaOPBRB1WfLu6tceY,1353
41
42
  uipath/_services/__init__.py,sha256=VPbwLDsvN26nWZgvR-8_-tc3i0rk5doqjTJbSrK0nN4,818
42
43
  uipath/_services/_base_service.py,sha256=3YClCoZBkVQGNJZGy-4NTk-HGsGA61XtwVQFYv9mwWk,7955
43
44
  uipath/_services/actions_service.py,sha256=RNrR6v42ivpSLtv1W4ctqittScMr9pFUHl9CKOn7tdU,15795
@@ -77,8 +78,8 @@ uipath/tracing/__init__.py,sha256=GimSzv6qkCOlHOG1WtjYKJsZqcXpA28IgoXfR33JhiA,13
77
78
  uipath/tracing/_otel_exporters.py,sha256=x0PDPmDKJcxashsuehVsSsqBCzRr6WsNFaq_3_HS5F0,3014
78
79
  uipath/tracing/_traced.py,sha256=GFxOp73jk0vGTN_H7YZOOsEl9rVLaEhXGztMiYKIA-8,16634
79
80
  uipath/tracing/_utils.py,sha256=5SwsTGpHkIouXBndw-u8eCLnN4p7LM8DsTCCuf2jJgs,10165
80
- uipath-2.0.26.dist-info/METADATA,sha256=v0nkvuROqaY1ETPWX3tOQuYQfcLuKlcd17S3fbwDd8E,6106
81
- uipath-2.0.26.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
82
- uipath-2.0.26.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
83
- uipath-2.0.26.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
84
- uipath-2.0.26.dist-info/RECORD,,
81
+ uipath-2.0.27.dist-info/METADATA,sha256=6haVZ7k0TSaBU-GTow-z4yvtAlNKiB0rnL3He5IHWpY,6106
82
+ uipath-2.0.27.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
83
+ uipath-2.0.27.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
84
+ uipath-2.0.27.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
85
+ uipath-2.0.27.dist-info/RECORD,,