tinybird 0.0.1.dev82__py3-none-any.whl → 0.0.1.dev84__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/cli/introduction.html'
5
5
  __author__ = 'Tinybird'
6
6
  __author_email__ = 'support@tinybird.co'
7
- __version__ = '0.0.1.dev82'
8
- __revision__ = '6ef6586'
7
+ __version__ = '0.0.1.dev84'
8
+ __revision__ = '4b1189a'
@@ -108,7 +108,8 @@ async def cli(
108
108
 
109
109
  config = await get_config(host, token, config_file=config_temp._path)
110
110
  client = _get_tb_client(config.get("token", None), config["host"])
111
- project = Project(folder=config.get("cwd", os.getcwd()))
111
+ folder = os.path.join(config_temp._path.replace(".tinyb", ""), config.get("cwd", os.getcwd()))
112
+ project = Project(folder=folder)
112
113
  config["path"] = str(project.path)
113
114
  # If they have passed a token or host as paramter and it's different that record in .tinyb, refresh the workspace id
114
115
  if token or host:
@@ -393,7 +394,7 @@ def __unpatch_click_output():
393
394
 
394
395
 
395
396
  async def create_ctx_client(ctx: Context, config: Dict[str, Any], cloud: bool, build: bool, staging: bool):
396
- commands_without_ctx_client = ["auth", "check", "login", "local", "upgrade"]
397
+ commands_without_ctx_client = ["auth", "check", "login", "local", "update", "upgrade"]
397
398
  command = ctx.invoked_subcommand
398
399
  if command in commands_without_ctx_client:
399
400
  return None
@@ -108,9 +108,9 @@ def remove_tinybird_local(docker_client):
108
108
 
109
109
 
110
110
  @cli.command()
111
- def upgrade():
112
- """Upgrade Tinybird CLI to the latest version."""
113
- click.echo(FeedbackManager.highlight(message="» Upgrading Tinybird CLI..."))
111
+ def update():
112
+ """Update Tinybird CLI to the latest version."""
113
+ click.echo(FeedbackManager.highlight(message="» Updating Tinybird CLI..."))
114
114
  process = subprocess.Popen(
115
115
  [f"{os.getenv('HOME')}/.local/bin/uv", "tool", "upgrade", "tinybird"],
116
116
  stdout=subprocess.PIPE,
@@ -118,10 +118,16 @@ def upgrade():
118
118
  text=True,
119
119
  )
120
120
  stdout, stderr = process.communicate()
121
- if "Nothing to upgrade" not in stdout + stderr:
122
- click.echo(FeedbackManager.success(message="✓ Tinybird CLI upgraded"))
121
+ if "Nothing to update" not in stdout + stderr:
122
+ click.echo(FeedbackManager.success(message="✓ Tinybird CLI updated"))
123
123
  else:
124
- click.echo(FeedbackManager.info(message="✓ Tinybird CLI is already up to date"))
124
+ click.echo(FeedbackManager.info(message="✓ Tinybird CLI is already up-to-date"))
125
+
126
+
127
+ @cli.command(name="upgrade", hidden=True)
128
+ def upgrade():
129
+ """Alias for tb update."""
130
+ update()
125
131
 
126
132
 
127
133
  @cli.group()
@@ -11,6 +11,7 @@ from watchdog.events import (
11
11
  FileDeletedEvent,
12
12
  FileMovedEvent,
13
13
  FileSystemEventHandler,
14
+ PatternMatchingEventHandler,
14
15
  )
15
16
  from watchdog.observers import Observer
16
17
 
@@ -20,21 +21,22 @@ from tinybird.tb.modules.project import Project
20
21
  from tinybird.tb.modules.shell import Shell
21
22
 
22
23
 
23
- class WatchProjectHandler(FileSystemEventHandler):
24
+ class WatchProjectHandler(PatternMatchingEventHandler):
25
+ valid_extensions = [".datasource", ".pipe", ".ndjson", ".sql"]
26
+
24
27
  def __init__(self, shell: Shell, project: Project, process: Callable):
25
28
  self.shell = shell
26
29
  self.project = project
27
30
  self.process = process
28
31
  self.datafiles = project.get_project_datafiles()
29
- super().__init__()
32
+ patterns = [f"{project.path}/**/*{ext}" for ext in self.valid_extensions]
33
+ super().__init__(patterns=patterns)
30
34
 
31
35
  def should_process(self, event: Any) -> Optional[str]:
32
36
  if event.is_directory:
33
37
  return None
34
38
 
35
- valid_extensions = [".datasource", ".pipe", ".ndjson", ".sql"]
36
-
37
- if not any(event.src_path.endswith(ext) for ext in valid_extensions):
39
+ if not any(event.src_path.endswith(ext) for ext in self.valid_extensions):
38
40
  return None
39
41
 
40
42
  if os.path.exists(event.src_path):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev82
3
+ Version: 0.0.1.dev84
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -15,12 +15,12 @@ tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
15
15
  tinybird/tornado_template.py,sha256=KmW_VD7y-NVqrc8YZKwIaxoJB0XpCcB2izdmxmtmApM,41944
16
16
  tinybird/ch_utils/constants.py,sha256=aYvg2C_WxYWsnqPdZB1ZFoIr8ZY-XjUXYyHKE9Ansj0,3890
17
17
  tinybird/ch_utils/engine.py,sha256=AUAww-KjGOZg9h0IBlKA3FeacJYB4rOtqcTGJhFM-g8,40392
18
- tinybird/tb/__cli__.py,sha256=ezu8vf-QOzUbTt44Gb65yoYa0VsoKoBZ5vj7XkSjB6Y,251
18
+ tinybird/tb/__cli__.py,sha256=FC-GlIYBtZ-3DZ0U5PiqDo9R02ndyOHYLc0p3qgXun0,251
19
19
  tinybird/tb/cli.py,sha256=KpJ_-V6xVEzcdPRPnHhEdh2EgRPCyhZnfJVqeqMsftI,964
20
20
  tinybird/tb/modules/auth.py,sha256=L1IatO2arRSzys3t8px8xVt8uPWUL5EVD0sFzAV_uVU,9022
21
21
  tinybird/tb/modules/build.py,sha256=46ZTxubughaq8QDV6yq9thatSVVY4yNqyzbfxRBcgDA,10446
22
22
  tinybird/tb/modules/cicd.py,sha256=T0lb9u_bDdTUVe8TwNNb1qQ5KnSPHMVjqPfKF4BBNBw,5347
23
- tinybird/tb/modules/cli.py,sha256=ldy1_sxQx6hwJYsMtJm_epHljIrfHXI6E2PgoDKZpVc,16362
23
+ tinybird/tb/modules/cli.py,sha256=Vwppm05Y9fKLY_Yo5pleMkcd8q7e-bqgXWGtNQmLan0,16447
24
24
  tinybird/tb/modules/common.py,sha256=f5yKjb1dgUzR-SrC4UHnpHXYIu6INcTHwNO96jW8A9w,73201
25
25
  tinybird/tb/modules/config.py,sha256=wIsoIf2yMCT2JQ5f6nZr-WzB7Uuah9EqXf6Glxe_p-Q,11353
26
26
  tinybird/tb/modules/copy.py,sha256=MAVqKip8_QhOYq99U_XuqSO6hCLJEh5sFtbhcXtI3SI,5802
@@ -34,7 +34,7 @@ tinybird/tb/modules/fmt.py,sha256=qpf9APqKTKL2uphNgdbj4OMVyLkAxZn6dn4eHF99L5g,35
34
34
  tinybird/tb/modules/job.py,sha256=956Pj8BEEsiD2GZsV9RKKVM3I_CveOLgS82lykO5ukk,2963
35
35
  tinybird/tb/modules/llm.py,sha256=AC0VSphTOM2t-v1_3NLvNN_FIbgMo4dTyMqIv5nniPo,835
36
36
  tinybird/tb/modules/llm_utils.py,sha256=nS9r4FAElJw8yXtmdYrx-rtI2zXR8qXfi1QqUDCfxvg,3469
37
- tinybird/tb/modules/local.py,sha256=9SZa-59eYROuwFNjJAHD0dRKLK5Reozh9WdchvfSsmQ,5680
37
+ tinybird/tb/modules/local.py,sha256=uCyoWXxYp3sMxK50kAOaZXSLDzg5ahjKmVjc98ZRGX4,5778
38
38
  tinybird/tb/modules/local_common.py,sha256=jWNyoMBxamjEWLqyIhF50t3vz75CuZThekhDmP4cgQ4,3055
39
39
  tinybird/tb/modules/login.py,sha256=NB-evr7b00ChKPulX7c8YLN3EX6cr0CwALN0wroAq3o,6147
40
40
  tinybird/tb/modules/materialization.py,sha256=r8Q9HXcYEmfrEzP4WpiasCKDJdSkTPaAKJtZMoJKhi8,5749
@@ -49,7 +49,7 @@ tinybird/tb/modules/tag.py,sha256=anPmMUBc-TbFovlpFi8GPkKA18y7Y0GczMsMms5TZsU,35
49
49
  tinybird/tb/modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
50
50
  tinybird/tb/modules/test.py,sha256=oa6_ApTCT526W8-hngpZwNyl2AbIpOztOsxf0iwlSwc,11547
51
51
  tinybird/tb/modules/token.py,sha256=OhqLFpCHVfYeBCxJ0n7n2qoho9E9eGcUfHgL7R1MUVQ,13485
52
- tinybird/tb/modules/watch.py,sha256=ldB29Y_v1amXcYWhh2hhhV3tekPioXQ7noEhPZhW2Ok,8670
52
+ tinybird/tb/modules/watch.py,sha256=qMQhewRSso1AFSEFLuyeyGFA8Lxf9ccYJxmVdPU1BgM,8808
53
53
  tinybird/tb/modules/workspace.py,sha256=fF0W6M5_qdwbbXpCUfuhon7CR0NhOOA0XOv5jD2l1JI,6401
54
54
  tinybird/tb/modules/workspace_members.py,sha256=Vb5XEaKmkfONyfg2MS5EcpwolMvv7GLwFS5m2EuobT8,8726
55
55
  tinybird/tb/modules/datafile/build.py,sha256=seGFSvmgyRrAM1-icsKBkuog3WccfGUYFTPT-xoA5W8,50940
@@ -76,8 +76,8 @@ tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4
76
76
  tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
77
77
  tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
78
78
  tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
79
- tinybird-0.0.1.dev82.dist-info/METADATA,sha256=bcfHRBRtdZrTNN6KIzNtv3-Vrsj5wiHl_bLKfZByU88,2585
80
- tinybird-0.0.1.dev82.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
81
- tinybird-0.0.1.dev82.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
82
- tinybird-0.0.1.dev82.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
83
- tinybird-0.0.1.dev82.dist-info/RECORD,,
79
+ tinybird-0.0.1.dev84.dist-info/METADATA,sha256=U7VIvdwrTwKDu7D68zYVeqBZxHumETDfTD1dQyeHQC0,2585
80
+ tinybird-0.0.1.dev84.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
81
+ tinybird-0.0.1.dev84.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
82
+ tinybird-0.0.1.dev84.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
83
+ tinybird-0.0.1.dev84.dist-info/RECORD,,