truefoundry 0.10.6__py3-none-any.whl → 0.10.7__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 truefoundry might be problematic. Click here for more details.

truefoundry/cli/util.py CHANGED
@@ -7,6 +7,7 @@ import questionary
7
7
  import rich_click as click
8
8
  from packaging.version import parse as parse_version
9
9
  from requests.exceptions import ConnectionError, Timeout
10
+ from rich.markup import escape
10
11
  from rich.padding import Padding
11
12
  from rich.panel import Panel
12
13
  from rich.table import Table
@@ -15,6 +16,14 @@ from truefoundry.cli.config import CliConfig
15
16
  from truefoundry.cli.console import console
16
17
  from truefoundry.common.exceptions import HttpRequestException
17
18
 
19
+ try:
20
+ import importlib.metadata as importlib_metadata
21
+ except ImportError:
22
+ import importlib_metadata
23
+
24
+
25
+ _CLICK_VERSION = None
26
+
18
27
 
19
28
  def setup_rich_click():
20
29
  click.rich_click.STYLE_ERRORS_SUGGESTION = "blue italic"
@@ -28,7 +37,10 @@ def handle_exception(exception):
28
37
  console.print_exception(show_locals=True)
29
38
  if isinstance(exception, HttpRequestException):
30
39
  print_dict_as_table_panel(
31
- {"Status Code": str(exception.status_code), "Error": exception.message},
40
+ {
41
+ "Status Code": str(exception.status_code),
42
+ "Error": escape(exception.message),
43
+ },
32
44
  title="Command Failed",
33
45
  border_style="red",
34
46
  )
@@ -57,7 +69,7 @@ def handle_exception(exception):
57
69
  console.print_exception(show_locals=False, max_frames=1)
58
70
  else:
59
71
  print_dict_as_table_panel(
60
- {"Error": str(exception)},
72
+ {"Error": escape(str(exception))},
61
73
  title="Command Failed",
62
74
  border_style="red",
63
75
  )
@@ -128,11 +140,17 @@ def unzip_package(path_to_package, destination):
128
140
  zip_ref.extractall(destination)
129
141
 
130
142
 
131
- def _prompt_if_no_value_and_supported(prompt: str, hide_input: bool = True):
132
- import click as _click
133
-
143
+ def prompt_if_no_value_and_supported(prompt: str, hide_input: bool = True):
144
+ global _CLICK_VERSION
134
145
  kwargs = {}
135
- if parse_version(_click.__version__).major >= 8:
146
+
147
+ if _CLICK_VERSION is None:
148
+ try:
149
+ _CLICK_VERSION = parse_version(importlib_metadata.version("click"))
150
+ except Exception:
151
+ _CLICK_VERSION = parse_version("0.0.0")
152
+
153
+ if _CLICK_VERSION.major >= 8:
136
154
  kwargs = {"prompt": prompt, "hide_input": hide_input, "prompt_required": False}
137
155
 
138
156
  return kwargs
@@ -2,8 +2,8 @@ import rich_click as click
2
2
 
3
3
  from truefoundry.cli.const import COMMAND_CLS
4
4
  from truefoundry.cli.util import (
5
- _prompt_if_no_value_and_supported,
6
5
  handle_exception_wrapper,
6
+ prompt_if_no_value_and_supported,
7
7
  )
8
8
  from truefoundry.common.constants import TFY_HOST_ENV_KEY
9
9
  from truefoundry.deploy.io.rich_output_callback import RichOutputCallBack
@@ -24,7 +24,7 @@ from truefoundry.deploy.lib.session import login
24
24
  "--api_key",
25
25
  type=click.STRING,
26
26
  default=None,
27
- **_prompt_if_no_value_and_supported(prompt="API Key", hide_input=True),
27
+ **prompt_if_no_value_and_supported(prompt="API Key", hide_input=True),
28
28
  )
29
29
  @handle_exception_wrapper
30
30
  def login_command(relogin: bool, host: str, api_key: str):
@@ -1,3 +1,4 @@
1
+ import copy
1
2
  import difflib
2
3
  from typing import Any, Dict, Optional
3
4
 
@@ -7,6 +8,25 @@ from rich.markdown import Markdown
7
8
  from rich.panel import Panel
8
9
 
9
10
 
11
+ def _normalize_manifest_for_diff(obj: Any) -> Any:
12
+ """
13
+ Normalize a manifest object for consistent diffing.
14
+ Only sorts the 'integrations' field by name
15
+ """
16
+ if isinstance(obj, dict):
17
+ _type = obj.get("type") or ""
18
+ integrations = obj.get("integrations")
19
+ if (
20
+ _type.startswith("provider-account/")
21
+ and isinstance(integrations, list)
22
+ and all(isinstance(item, dict) and "name" in item for item in integrations)
23
+ ):
24
+ result = copy.deepcopy(obj)
25
+ result["integrations"] = sorted(integrations, key=lambda x: x["name"])
26
+ return result
27
+ return obj
28
+
29
+
10
30
  def format_manifest_for_diff(manifest: Dict[str, Any]) -> str:
11
31
  """
12
32
  Format a manifest for diffing with consistent formatting.
@@ -17,7 +37,9 @@ def format_manifest_for_diff(manifest: Dict[str, Any]) -> str:
17
37
  Returns:
18
38
  A consistently formatted YAML string suitable for diffing
19
39
  """
20
- return yaml.dump(manifest, sort_keys=True, indent=2)
40
+ # Normalize the manifest for diffing
41
+ normalized_manifest = _normalize_manifest_for_diff(manifest)
42
+ return yaml.dump(normalized_manifest, sort_keys=True, indent=2)
21
43
 
22
44
 
23
45
  def generate_manifest_diff(
@@ -200,7 +200,7 @@ def _deploy_wait_handler( # noqa: C901
200
200
  time_elapsed = time.monotonic() - start_time
201
201
  if time_elapsed > total_timeout_time:
202
202
  logger.warning(
203
- "Polled server for %s secs. Disconnecting from server, the deployment will still continue.",
203
+ "Polled build logs for %s secs. Disconnecting from server, the deployment will still continue.",
204
204
  int(time_elapsed),
205
205
  )
206
206
  if socket and socket.connected:
truefoundry/version.py CHANGED
@@ -1,6 +1,9 @@
1
1
  try:
2
- import importlib.metadata
2
+ import importlib.metadata as importlib_metadata
3
+ except ImportError:
4
+ import importlib_metadata
3
5
 
4
- __version__ = importlib.metadata.version("truefoundry")
6
+ try:
7
+ __version__ = importlib_metadata.version("truefoundry")
5
8
  except Exception:
6
9
  __version__ = "NA"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: truefoundry
3
- Version: 0.10.6
3
+ Version: 0.10.7
4
4
  Summary: TrueFoundry CLI
5
5
  Author-email: TrueFoundry Team <abhishek@truefoundry.com>
6
6
  Requires-Python: <3.14,>=3.8.1
@@ -2,7 +2,7 @@ truefoundry/__init__.py,sha256=z9iNNI3mqVWkvzBXMRu096jXaYloYSN6rnlTbfmKcJE,1056
2
2
  truefoundry/_client.py,sha256=Y3qHi_Lg4Sx6GNvsjAHIoAfFr8PJnqgCrXmpNAI3ECg,1417
3
3
  truefoundry/logger.py,sha256=u-YCNjg5HBwE70uQcpjIG64Ghos-K2ulTWaxC03BSj4,714
4
4
  truefoundry/pydantic_v1.py,sha256=jSuhGtz0Mbk1qYu8jJ1AcnIDK4oxUsdhALc4spqstmM,345
5
- truefoundry/version.py,sha256=bqiT4Q-VWrTC6P4qfK43mez-Ppf-smWfrl6DcwV7mrw,137
5
+ truefoundry/version.py,sha256=xaf13PCnuYzw9j8IqtCn6XVEVbgBba6sLn_u_NLFfrs,214
6
6
  truefoundry/_ask/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  truefoundry/_ask/cli.py,sha256=RDi1lwbUMYw0CnvaYG4o6o1phmnKjuggdQ5I8sllTlA,5812
8
8
  truefoundry/_ask/client.py,sha256=QWQRiDwmtIlLaZsyGcLZaQstYFzpmJeCRdATMapjL-8,18740
@@ -37,7 +37,7 @@ truefoundry/cli/config.py,sha256=f7z0_gmYZiNImB7Bxz0AnOlrxY2X4lFnX4jYW1I7NHQ,139
37
37
  truefoundry/cli/console.py,sha256=9-dMy4YPisCJQziRKTg8Qa0UJnOGl1soiUnJjsnLDvE,242
38
38
  truefoundry/cli/const.py,sha256=dVHPo1uAiDSSMXwXoT2mR5kNQjExT98QNVRz98Hz_Ts,510
39
39
  truefoundry/cli/display_util.py,sha256=9vzN3mbQqU6OhS7qRUiMRana4PTHa4sDTA0Hn7OVjCI,3108
40
- truefoundry/cli/util.py,sha256=sSKFZ5wGkForoRIiKD2gFlMyj9D1iinzdjQtMYJx8oU,5015
40
+ truefoundry/cli/util.py,sha256=kEjC20-n_jwxZV9jq-78CxDk4xAySxAoYIXTxZfJzLM,5423
41
41
  truefoundry/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
42
  truefoundry/common/auth_service_client.py,sha256=N3YxKlx63r6cPZqbgb2lqBOPI69ShB7D7RCIq4FSCjc,7949
43
43
  truefoundry/common/constants.py,sha256=nWd3Je71WmHEORRUTCupZy5fWADqEFftjYP6wiYhCIc,4627
@@ -78,7 +78,7 @@ truefoundry/deploy/cli/commands/deploy_init_command.py,sha256=g-jBfrEmhZ0TDWsyqP
78
78
  truefoundry/deploy/cli/commands/get_command.py,sha256=bR8tAjQQhimzaTQ57L6BPJwcxQ_SGWCF5CqHDpxgG90,837
79
79
  truefoundry/deploy/cli/commands/k8s_exec_credential_command.py,sha256=EknpdufMAEnjSGMG7a-Jj7tkoiS5zmbJRREafb14Alw,2160
80
80
  truefoundry/deploy/cli/commands/kubeconfig_command.py,sha256=WTYCv_itwUb6kwlsGkq3hwn5i-Gjd7cVrbBhoLZDnJI,3146
81
- truefoundry/deploy/cli/commands/login_command.py,sha256=kbEs4leyMYK2kz7L9ql2PXVgLVmCYo-LWtnntVVYLFY,1065
81
+ truefoundry/deploy/cli/commands/login_command.py,sha256=GdFrH2zgFFrSZi35p6MPDkQi4h4ScYX5UqDnyhe1cLg,1063
82
82
  truefoundry/deploy/cli/commands/logout_command.py,sha256=u3kfrEp0ETbrz40KjD4GCC3XEZ5YRAlrca_Df4U_mk0,536
83
83
  truefoundry/deploy/cli/commands/logs_command.py,sha256=osl2z5VaIceB9sYa6GtwsuyAPZKcw-A0oVEt3g1f62Q,4140
84
84
  truefoundry/deploy/cli/commands/patch_application_command.py,sha256=aRTHu2OmxQd7j9iE0RavsFCkCILp0rGh4DJO51Oij5I,2591
@@ -95,7 +95,7 @@ truefoundry/deploy/io/output_callback.py,sha256=_q79-dpFxnU762VPM9Ryy2gnuJnIotZ2
95
95
  truefoundry/deploy/io/rich_output_callback.py,sha256=m99RodkILXCgy_LJujEcojbpW1tL0H5Fjb0lqe6X_PQ,958
96
96
  truefoundry/deploy/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
97
97
  truefoundry/deploy/lib/const.py,sha256=Wg0GDnfFu-g1fJr4lU80NH2ULw0R0dYjV7LnW-PbOeM,173
98
- truefoundry/deploy/lib/diff_utils.py,sha256=SszFgzBQ7GPwpgJKWjLDT-IQ_AcMB9mW8OP27Uj37HE,2627
98
+ truefoundry/deploy/lib/diff_utils.py,sha256=J1sAf5O4rHNHS_MOkcB0CyaeQFtU_ALI-wd--g8ZDZA,3417
99
99
  truefoundry/deploy/lib/logs_utils.py,sha256=SQxRv3jDDmgHdOUMhlMaAPGYskybnBUMpst7QU_i_sc,1469
100
100
  truefoundry/deploy/lib/messages.py,sha256=8424kj3kqCyDCX5Nr2WJZZ_UEutPoaSs_y2f9-O4yy8,1001
101
101
  truefoundry/deploy/lib/session.py,sha256=fLdgR6ZDp8-hFl5NTON4ngnWLsMzGxvKtfpDOOw_7lo,4963
@@ -113,7 +113,7 @@ truefoundry/deploy/lib/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
113
113
  truefoundry/deploy/lib/model/entity.py,sha256=eBfA4trO0jUuDy0wifiu2rB_HryZrx5Kf-tRMwIQ_9g,8716
114
114
  truefoundry/deploy/v2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
115
115
  truefoundry/deploy/v2/lib/__init__.py,sha256=WEiVMZXOVljzEE3tpGJil14liIn_PCDoACJ6b3tZ6sI,188
116
- truefoundry/deploy/v2/lib/deploy.py,sha256=HfSUdAS3gSpFAFtV0Mq9LscfpkaXqA2LHW4VXqk9Y0g,12707
116
+ truefoundry/deploy/v2/lib/deploy.py,sha256=Ltm7cpIW14IbmEsR3EAIeWQUch2Z6HLej7heuFLRAnE,12711
117
117
  truefoundry/deploy/v2/lib/deploy_workflow.py,sha256=G5BzMIbap8pgDX1eY-TITruUxQdkKhYtBmRwLL6lDeY,14342
118
118
  truefoundry/deploy/v2/lib/deployable_patched_models.py,sha256=mUi-OjPf7bc8rzfrPLdFb79LKuDq7F36RxL4V-AXebs,6830
119
119
  truefoundry/deploy/v2/lib/models.py,sha256=ogc1UYs1Z2nBdGSKCrde9sk8d0GxFKMkem99uqO5CmM,1148
@@ -381,7 +381,7 @@ truefoundry/workflow/remote_filesystem/__init__.py,sha256=LQ95ViEjJ7Ts4JcCGOxMPs
381
381
  truefoundry/workflow/remote_filesystem/logger.py,sha256=em2l7D6sw7xTLDP0kQSLpgfRRCLpN14Qw85TN7ujQcE,1022
382
382
  truefoundry/workflow/remote_filesystem/tfy_signed_url_client.py,sha256=xcT0wQmQlgzcj0nP3tJopyFSVWT1uv3nhiTIuwfXYeg,12342
383
383
  truefoundry/workflow/remote_filesystem/tfy_signed_url_fs.py,sha256=nSGPZu0Gyd_jz0KsEE-7w_BmnTD8CVF1S8cUJoxaCbc,13305
384
- truefoundry-0.10.6.dist-info/METADATA,sha256=CN96HcoQd_5lWHozK46eDlDnN1l_ZIrTXHHKwHS8eKc,2505
385
- truefoundry-0.10.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
386
- truefoundry-0.10.6.dist-info/entry_points.txt,sha256=xVjn7RMN-MW2-9f7YU-bBdlZSvvrwzhpX1zmmRmsNPU,98
387
- truefoundry-0.10.6.dist-info/RECORD,,
384
+ truefoundry-0.10.7.dist-info/METADATA,sha256=11sG5XlP_FSog6uFEZ2yMAPOPrByJLBn8H9L_RIvW3A,2505
385
+ truefoundry-0.10.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
386
+ truefoundry-0.10.7.dist-info/entry_points.txt,sha256=xVjn7RMN-MW2-9f7YU-bBdlZSvvrwzhpX1zmmRmsNPU,98
387
+ truefoundry-0.10.7.dist-info/RECORD,,