tinybird 0.0.1.dev279__py3-none-any.whl → 0.0.1.dev280__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 tinybird might be problematic. Click here for more details.

tinybird/tb/__cli__.py CHANGED
@@ -4,5 +4,5 @@ __description__ = 'Tinybird Command Line Tool'
4
4
  __url__ = 'https://www.tinybird.co/docs/forward/commands'
5
5
  __author__ = 'Tinybird'
6
6
  __author_email__ = 'support@tinybird.co'
7
- __version__ = '0.0.1.dev279'
8
- __revision__ = '9848d86'
7
+ __version__ = '0.0.1.dev280'
8
+ __revision__ = 'e419ff7'
@@ -14,7 +14,9 @@ from pydantic_ai import Agent, RunContext, Tool
14
14
  from pydantic_ai.messages import ModelMessage, ModelRequest, UserPromptPart
15
15
  from requests import Response
16
16
 
17
+ from tinybird.tb.check_pypi import CheckPypi
17
18
  from tinybird.tb.client import TinyB
19
+ from tinybird.tb.config import CURRENT_VERSION
18
20
  from tinybird.tb.modules.agent.animations import ThinkingAnimation
19
21
  from tinybird.tb.modules.agent.banner import display_banner
20
22
  from tinybird.tb.modules.agent.command_agent import CommandAgent
@@ -54,6 +56,7 @@ from tinybird.tb.modules.common import (
54
56
  echo_safe_humanfriendly_tables_format_pretty_table,
55
57
  get_region_from_host,
56
58
  get_regions,
59
+ update_cli,
57
60
  )
58
61
  from tinybird.tb.modules.config import CLIConfig
59
62
  from tinybird.tb.modules.deployment_common import create_deployment
@@ -368,6 +371,19 @@ class TinybirdAgent:
368
371
  def run_agent(
369
372
  config: dict[str, Any], project: Project, dangerously_skip_permissions: bool, prompt: Optional[str] = None
370
373
  ):
374
+ if not prompt:
375
+ latest_version = CheckPypi().get_latest_version()
376
+ if latest_version and "x.y.z" not in CURRENT_VERSION and latest_version != CURRENT_VERSION:
377
+ yes = click.confirm(
378
+ FeedbackManager.warning(
379
+ message=f"New version available. {CURRENT_VERSION} -> {latest_version}. Do you want to update now? [Y/n]"
380
+ ),
381
+ show_default=False,
382
+ default=True,
383
+ prompt_suffix="",
384
+ )
385
+ if yes:
386
+ update_cli()
371
387
  click.echo(FeedbackManager.highlight(message="» Initializing Tinybird Code..."))
372
388
  token = config.get("token", None)
373
389
  host = config.get("host", None)
@@ -121,7 +121,8 @@ def cli(
121
121
  if getenv_bool("TB_DISABLE_SSL_CHECKS", False):
122
122
  click.echo(FeedbackManager.warning_disabled_ssl_checks())
123
123
 
124
- if not environ.get("PYTEST", None) and version_warning and not token:
124
+ is_agent_mode = ctx.invoked_subcommand is None
125
+ if not environ.get("PYTEST", None) and version_warning and not token and not is_agent_mode:
125
126
  latest_version = CheckPypi().get_latest_version()
126
127
  if latest_version:
127
128
  if "x.y.z" in CURRENT_VERSION:
@@ -204,7 +205,6 @@ def cli(
204
205
  ctx.ensure_object(dict)["env"] = get_target_env(cloud)
205
206
  ctx.ensure_object(dict)["output"] = output
206
207
 
207
- is_agent_mode = ctx.invoked_subcommand is None
208
208
  is_prompt_mode = prompt is not None
209
209
 
210
210
  if is_agent_mode or is_prompt_mode:
@@ -9,6 +9,7 @@ import json
9
9
  import os
10
10
  import re
11
11
  import socket
12
+ import subprocess
12
13
  import sys
13
14
  import time
14
15
  import uuid
@@ -2234,3 +2235,30 @@ def force_echo(string: str) -> None:
2234
2235
 
2235
2236
  def echo_json(data: Dict[str, Any], indent: Union[None, int, str] = None) -> None:
2236
2237
  force_echo(json.dumps(data, indent=indent))
2238
+
2239
+
2240
+ def update_cli() -> None:
2241
+ click.echo(FeedbackManager.highlight(message="» Updating Tinybird CLI..."))
2242
+
2243
+ try:
2244
+ process = subprocess.Popen(
2245
+ ["uv", "tool", "upgrade", "tinybird"],
2246
+ stdout=subprocess.PIPE,
2247
+ stderr=subprocess.PIPE,
2248
+ text=True,
2249
+ )
2250
+ except FileNotFoundError:
2251
+ raise CLIException(
2252
+ FeedbackManager.error(
2253
+ message="Cannot find required tool: uv. Reinstall using: curl https://tinybird.co | sh"
2254
+ )
2255
+ )
2256
+
2257
+ stdout, stderr = process.communicate()
2258
+ if "Nothing to upgrade" not in stdout + stderr:
2259
+ for line in stdout.split("\n") + stderr.split("\n"):
2260
+ if "Updated tinybird" in line:
2261
+ click.echo(FeedbackManager.info(message=f"» {line}"))
2262
+ click.echo(FeedbackManager.success(message="✓ Tinybird CLI updated"))
2263
+ else:
2264
+ click.echo(FeedbackManager.info(message="✓ Tinybird CLI is already up-to-date"))
@@ -1,4 +1,3 @@
1
- import subprocess
2
1
  from pathlib import Path
3
2
 
4
3
  import click
@@ -6,7 +5,7 @@ import requests
6
5
 
7
6
  from docker.client import DockerClient
8
7
  from tinybird.tb.modules.cli import cli
9
- from tinybird.tb.modules.exceptions import CLIException
8
+ from tinybird.tb.modules.common import update_cli
10
9
  from tinybird.tb.modules.feedback_manager import FeedbackManager
11
10
  from tinybird.tb.modules.local_common import (
12
11
  TB_CONTAINER_NAME,
@@ -42,33 +41,6 @@ def remove_tinybird_local(docker_client: DockerClient, persist_data: bool) -> No
42
41
  pass
43
42
 
44
43
 
45
- def update_cli() -> None:
46
- click.echo(FeedbackManager.highlight(message="» Updating Tinybird CLI..."))
47
-
48
- try:
49
- process = subprocess.Popen(
50
- ["uv", "tool", "upgrade", "tinybird"],
51
- stdout=subprocess.PIPE,
52
- stderr=subprocess.PIPE,
53
- text=True,
54
- )
55
- except FileNotFoundError:
56
- raise CLIException(
57
- FeedbackManager.error(
58
- message="Cannot find required tool: uv. Reinstall using: curl https://tinybird.co | sh"
59
- )
60
- )
61
-
62
- stdout, stderr = process.communicate()
63
- if "Nothing to upgrade" not in stdout + stderr:
64
- for line in stdout.split("\n") + stderr.split("\n"):
65
- if "Updated tinybird" in line:
66
- click.echo(FeedbackManager.info(message=f"» {line}"))
67
- click.echo(FeedbackManager.success(message="✓ Tinybird CLI updated"))
68
- else:
69
- click.echo(FeedbackManager.info(message="✓ Tinybird CLI is already up-to-date"))
70
-
71
-
72
44
  @cli.command()
73
45
  def update() -> None:
74
46
  """Update Tinybird CLI to the latest version."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev279
3
+ Version: 0.0.1.dev280
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -17,7 +17,7 @@ tinybird/datafile/exceptions.py,sha256=8rw2umdZjtby85QbuRKFO5ETz_eRHwUY5l7eHsy1w
17
17
  tinybird/datafile/parse_connection.py,sha256=tRyn2Rpr1TeWet5BXmMoQgaotbGdYep1qiTak_OqC5E,1825
18
18
  tinybird/datafile/parse_datasource.py,sha256=ssW8QeFSgglVFi3sDZj_HgkJiTJ2069v2JgqnH3CkDE,1825
19
19
  tinybird/datafile/parse_pipe.py,sha256=xf4m0Tw44QWJzHzAm7Z7FwUoUUtr7noMYjU1NiWnX0k,3880
20
- tinybird/tb/__cli__.py,sha256=BhEnCKben6XkQIpGAiFqJfgnLmzN6r_Drzso-JZ6Xs0,247
20
+ tinybird/tb/__cli__.py,sha256=Np8R1vyZCw8RP4hNX8uKd29Sq7xRKM_5NOXdcYnx258,247
21
21
  tinybird/tb/check_pypi.py,sha256=Gp0HkHHDFMSDL6nxKlOY51z7z1Uv-2LRexNTZSHHGmM,552
22
22
  tinybird/tb/cli.py,sha256=FdDFEIayjmsZEVsVSSvRiVYn_FHOVg_zWQzchnzfWho,1008
23
23
  tinybird/tb/client.py,sha256=IQRaInDjOwr9Fzaz3_xXc3aUGqh94tM2lew7IZbB9eM,53733
@@ -25,8 +25,8 @@ tinybird/tb/config.py,sha256=mhMTGnMB5KcxGoh3dewIr2Jjsa6pHE183gCPAQWyp6o,3973
25
25
  tinybird/tb/modules/build.py,sha256=lSCbmrqDxqa8bG009qgp2nNRpQW7JWgSen7UQNCfLVE,7657
26
26
  tinybird/tb/modules/build_common.py,sha256=KGCtyY1JGexXXhcMVFI3e-gRavmRfCoZnfGPSTYHGxk,12962
27
27
  tinybird/tb/modules/cicd.py,sha256=0KLKccha9IP749QvlXBmzdWv1On3mFwMY4DUcJlBxiE,7326
28
- tinybird/tb/modules/cli.py,sha256=-52CJC_JXXCoR91LecUuSD7wyKa-A779bECtFr1UCTM,16726
29
- tinybird/tb/modules/common.py,sha256=tj6DR2yOqMMQ0PILwFGXmMogxdrbQCgj36HdSM611rs,82657
28
+ tinybird/tb/modules/cli.py,sha256=QpEGFMtmwqnJRaK1KAtKkLsKHeJ39VHU5wFkDJJiCnk,16748
29
+ tinybird/tb/modules/common.py,sha256=zY0PFDQVWjhu2MivBtUmcXtAlv7imgO-RG_PUK37XvI,83659
30
30
  tinybird/tb/modules/config.py,sha256=gK7rgaWTDd4ZKCrNEg_Uemr26EQjqWt6TjyQKujxOws,11462
31
31
  tinybird/tb/modules/connection.py,sha256=axp8Fny1_4PSLJGN4UF6WygyRbQtM3Lbt6thxHKTxzw,17790
32
32
  tinybird/tb/modules/copy.py,sha256=dPZkcIDvxjJrlQUIvToO0vsEEEs4EYumbNV77-BzNoU,4404
@@ -44,7 +44,7 @@ tinybird/tb/modules/infra.py,sha256=JE9oLIyF4bi_JBoe-BgZ5HhKp_lQgSihuSV1KIS02Qs,
44
44
  tinybird/tb/modules/job.py,sha256=wBsnu8UPTOha2rkLvucgmw4xYv73ubmui3eeSIF68ZM,3107
45
45
  tinybird/tb/modules/llm.py,sha256=fPBBCmM3KlCksLlgJkg4joDn6y3H5QjDzE-Pm4YNf7E,1782
46
46
  tinybird/tb/modules/llm_utils.py,sha256=nS9r4FAElJw8yXtmdYrx-rtI2zXR8qXfi1QqUDCfxvg,3469
47
- tinybird/tb/modules/local.py,sha256=tpiw_F_qOIp42h3kTBwTm5GQDyuVLF0QNF1jmB0zR94,6845
47
+ tinybird/tb/modules/local.py,sha256=L6YWHgzILAwe9s1ZqnP1usjgI1u-Hs9KzxnB5JCdwC0,5837
48
48
  tinybird/tb/modules/local_common.py,sha256=8cnBh3eoHRV6Ze7Rg9bueF3Zb_wYDe54bm5cGRvrwbY,17596
49
49
  tinybird/tb/modules/login.py,sha256=zerXZqIv15pbFk5XRt746xGcVnp01YmL_403byBf4jQ,1245
50
50
  tinybird/tb/modules/login_common.py,sha256=IfthYbHmC7EtsCXCB1iF4TngPOwfaHJ6Dfi_t7oBXnI,11640
@@ -69,7 +69,7 @@ tinybird/tb/modules/watch.py,sha256=No0bK1M1_3CYuMaIgylxf7vYFJ72lTJe3brz6xQ-mJo,
69
69
  tinybird/tb/modules/workspace.py,sha256=USsG8YEXlwf7F2PjTMCuQ2lB8ya-erbv8VywNJYq6mc,11173
70
70
  tinybird/tb/modules/workspace_members.py,sha256=5JdkJgfuEwbq-t6vxkBhYwgsiTDxF790wsa6Xfif9nk,8608
71
71
  tinybird/tb/modules/agent/__init__.py,sha256=i3oe3vDIWWPaicdCM0zs7D7BJ1W0k7th93ooskHAV00,54
72
- tinybird/tb/modules/agent/agent.py,sha256=2RUOPhTszUXQKcZW3v9NcjC9vQrY7ShetVmgIcI2mgs,33004
72
+ tinybird/tb/modules/agent/agent.py,sha256=g5jsJ_HHbfR5rn9AoNJdKdkk3fE_2vqBp0kSNMlG46w,33671
73
73
  tinybird/tb/modules/agent/animations.py,sha256=4WOC5_2BracttmMCrV0H91tXfWcUzQHBUaIJc5FA7tE,3490
74
74
  tinybird/tb/modules/agent/banner.py,sha256=l6cO5Fi7lbVKp-GsBP8jf3IkjOWxg2jpAt9NBCy0WR8,4085
75
75
  tinybird/tb/modules/agent/command_agent.py,sha256=Wcdtmo7vJZ5EbBFW9J7zPCME0ShG_KqF6-qHmMB1XXk,3103
@@ -117,8 +117,8 @@ tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4
117
117
  tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
118
118
  tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
119
119
  tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
120
- tinybird-0.0.1.dev279.dist-info/METADATA,sha256=ghm_pGTehvUVQoLGPbTWB0ufWGyo1EflvV-uaeXtt74,1763
121
- tinybird-0.0.1.dev279.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
122
- tinybird-0.0.1.dev279.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
123
- tinybird-0.0.1.dev279.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
124
- tinybird-0.0.1.dev279.dist-info/RECORD,,
120
+ tinybird-0.0.1.dev280.dist-info/METADATA,sha256=-f88Tb0lj6EhwYrZtnTE2YqLF3u_g_G0KNu2IW8KwqY,1763
121
+ tinybird-0.0.1.dev280.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
122
+ tinybird-0.0.1.dev280.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
123
+ tinybird-0.0.1.dev280.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
124
+ tinybird-0.0.1.dev280.dist-info/RECORD,,