tinybird 0.0.1.dev235__py3-none-any.whl → 0.0.1.dev237__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.dev235'
8
- __revision__ = 'c22959d'
7
+ __version__ = '0.0.1.dev237'
8
+ __revision__ = '7aa96d2'
@@ -25,11 +25,11 @@ def stop_tinybird_local(docker_client: DockerClient) -> None:
25
25
  pass
26
26
 
27
27
 
28
- def remove_tinybird_local(docker_client: DockerClient) -> None:
28
+ def remove_tinybird_local(docker_client: DockerClient, persist_data: bool) -> None:
29
29
  """Remove the Tinybird container."""
30
30
  try:
31
31
  container = docker_client.containers.get(TB_CONTAINER_NAME)
32
- if click.confirm(
32
+ if persist_data or click.confirm(
33
33
  FeedbackManager.warning(
34
34
  message="△ This step will remove all your data inside Tinybird Local. Are you sure? [y/N]:"
35
35
  ),
@@ -130,7 +130,7 @@ def remove() -> None:
130
130
  """Remove Tinybird Local"""
131
131
  click.echo(FeedbackManager.highlight(message="» Removing Tinybird Local..."))
132
132
  docker_client = get_docker_client()
133
- remove_tinybird_local(docker_client)
133
+ remove_tinybird_local(docker_client, persist_data=False)
134
134
  click.echo(FeedbackManager.success(message="✓ Tinybird Local removed"))
135
135
 
136
136
 
@@ -141,11 +141,16 @@ def remove() -> None:
141
141
  is_flag=True,
142
142
  help="Use local AWS credentials from your environment and pass them to the Tinybird docker container",
143
143
  )
144
- def start(use_aws_creds: bool) -> None:
144
+ @click.option(
145
+ "--volumes-path",
146
+ default=None,
147
+ help="Path to the volumes directory. If not provided, the container data won't be persisted.",
148
+ )
149
+ def start(use_aws_creds: bool, volumes_path: str) -> None:
145
150
  """Start Tinybird Local"""
146
151
  click.echo(FeedbackManager.highlight(message="» Starting Tinybird Local..."))
147
152
  docker_client = get_docker_client()
148
- start_tinybird_local(docker_client, use_aws_creds)
153
+ start_tinybird_local(docker_client, use_aws_creds, volumes_path)
149
154
  click.echo(FeedbackManager.success(message="✓ Tinybird Local is ready!"))
150
155
 
151
156
 
@@ -156,13 +161,18 @@ def start(use_aws_creds: bool) -> None:
156
161
  is_flag=True,
157
162
  help="Use local AWS credentials from your environment and pass them to the Tinybird docker container",
158
163
  )
159
- def restart(use_aws_creds: bool) -> None:
164
+ @click.option(
165
+ "--volumes-path",
166
+ default=None,
167
+ help="Path to the volumes directory. If not provided, the container data won't be persisted.",
168
+ )
169
+ def restart(use_aws_creds: bool, volumes_path: str) -> None:
160
170
  """Restart Tinybird Local"""
161
171
  click.echo(FeedbackManager.highlight(message="» Restarting Tinybird Local..."))
162
172
  docker_client = get_docker_client()
163
- remove_tinybird_local(docker_client)
173
+ remove_tinybird_local(docker_client, volumes_path is not None)
164
174
  click.echo(FeedbackManager.info(message="✓ Tinybird Local stopped"))
165
- start_tinybird_local(docker_client, use_aws_creds)
175
+ start_tinybird_local(docker_client, use_aws_creds, volumes_path)
166
176
  click.echo(FeedbackManager.success(message="✓ Tinybird Local is ready!"))
167
177
 
168
178
 
@@ -106,7 +106,6 @@ def get_test_workspace_name(path: str) -> str:
106
106
 
107
107
  def get_local_tokens() -> Dict[str, str]:
108
108
  try:
109
- # ruff: noqa: ASYNC210
110
109
  return requests.get(f"{TB_LOCAL_ADDRESS}/tokens").json()
111
110
  except Exception:
112
111
  # Check if tinybird-local is running using docker client (some clients use podman and won't have docker cmd)
@@ -217,6 +216,7 @@ def get_local_tokens() -> Dict[str, str]:
217
216
  def start_tinybird_local(
218
217
  docker_client: DockerClient,
219
218
  use_aws_creds: bool,
219
+ volumes_path: Optional[str] = None,
220
220
  ) -> None:
221
221
  """Start the Tinybird container."""
222
222
  pull_show_prompt = False
@@ -252,6 +252,13 @@ def start_tinybird_local(
252
252
  if container:
253
253
  container.remove(force=True)
254
254
 
255
+ volumes = {}
256
+ if volumes_path:
257
+ volumes = {
258
+ f"{volumes_path}/data": {"bind": "/var/lib/clickhouse", "mode": "rw"},
259
+ f"{volumes_path}/metadata": {"bind": "/redis-data", "mode": "rw"},
260
+ }
261
+
255
262
  container = docker_client.containers.run(
256
263
  TB_IMAGE_NAME,
257
264
  name=TB_CONTAINER_NAME,
@@ -260,6 +267,7 @@ def start_tinybird_local(
260
267
  remove=False,
261
268
  platform="linux/amd64",
262
269
  environment=environment,
270
+ volumes=volumes,
263
271
  )
264
272
 
265
273
  click.echo(FeedbackManager.info(message="* Waiting for Tinybird Local to be ready..."))
@@ -179,14 +179,14 @@ def login(host: Optional[str], auth_host: str, workspace: str, interactive: bool
179
179
  )
180
180
  click.echo(FeedbackManager.info(message=auth_url))
181
181
 
182
- async def poll_for_tokens():
182
+ def poll_for_tokens():
183
183
  while True:
184
184
  params = {
185
185
  "apiHost": host,
186
186
  "cliCode": one_time_code,
187
187
  "method": "code",
188
188
  }
189
- response = requests.get(f"{auth_host}/api/cli-login?{urlencode(params)}") # noqa: ASYNC210
189
+ response = requests.get(f"{auth_host}/api/cli-login?{urlencode(params)}")
190
190
 
191
191
  try:
192
192
  if response.status_code == 200:
@@ -194,12 +194,12 @@ def login(host: Optional[str], auth_host: str, workspace: str, interactive: bool
194
194
  user_token = data.get("user_token", "")
195
195
  workspace_token = data.get("workspace_token", "")
196
196
  if user_token and workspace_token:
197
- await authenticate_with_tokens(data, host, cli_config)
197
+ authenticate_with_tokens(data, host, cli_config)
198
198
  break
199
199
  except Exception:
200
200
  pass
201
201
 
202
- time.sleep(2) # noqa: ASYNC251
202
+ time.sleep(2)
203
203
 
204
204
  poll_for_tokens()
205
205
  return
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev235
3
+ Version: 0.0.1.dev237
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=b4nj8uwvsmk28yWwIoYdrpRZlirPtMdv4UPFgQiG-ZQ,247
20
+ tinybird/tb/__cli__.py,sha256=vmMQxvQ7ux44Mfpu0EDdpMaLEOM4WmWMZ3dbG8YeI5s,247
21
21
  tinybird/tb/check_pypi.py,sha256=Gp0HkHHDFMSDL6nxKlOY51z7z1Uv-2LRexNTZSHHGmM,552
22
22
  tinybird/tb/cli.py,sha256=_5hIbxDFdLjMq0GiXpdoMIz7TdTpQ0DHfAS9MKdlST4,975
23
23
  tinybird/tb/client.py,sha256=cHJky5SF-z_epBajNovo_gaIRdMsU5KXx7vtVl4sdgE,53957
@@ -42,9 +42,9 @@ tinybird/tb/modules/infra.py,sha256=JE9oLIyF4bi_JBoe-BgZ5HhKp_lQgSihuSV1KIS02Qs,
42
42
  tinybird/tb/modules/job.py,sha256=wBsnu8UPTOha2rkLvucgmw4xYv73ubmui3eeSIF68ZM,3107
43
43
  tinybird/tb/modules/llm.py,sha256=QbHRcMLgFmLKEh4zVb2ctR_5tIGUGdFJrAiRCDtMxDw,1572
44
44
  tinybird/tb/modules/llm_utils.py,sha256=nS9r4FAElJw8yXtmdYrx-rtI2zXR8qXfi1QqUDCfxvg,3469
45
- tinybird/tb/modules/local.py,sha256=YIzmv0Hm63WhXGRAEFcpPWB0IVrZl1yrvY1VSKl_fD8,5986
46
- tinybird/tb/modules/local_common.py,sha256=BrtNjF5UhoD522LhpNBVHfIkJMFaGuXYpvv7I4mm-dw,17171
47
- tinybird/tb/modules/login.py,sha256=vZ7chla0mR9KlagUtLQLW_DxW9xkF3ZNTobavsfppyM,12545
45
+ tinybird/tb/modules/local.py,sha256=HTLUFb8xqR8_PEFkvZV1UB-uk2L66_DAh6eflce6_FE,6446
46
+ tinybird/tb/modules/local_common.py,sha256=_WODjW3oPshgsZ1jDFFx2nr0zrLi3Gxz5dlahWPobM8,17464
47
+ tinybird/tb/modules/login.py,sha256=glqj5RWH26AseEoBl8XfrSDEjQTdko17i_pVWOIMoGc,12497
48
48
  tinybird/tb/modules/logout.py,sha256=sniI4JNxpTrVeRCp0oGJuQ3yRerG4hH5uz6oBmjv724,1009
49
49
  tinybird/tb/modules/materialization.py,sha256=0O2JUCxLzz-DrXTUewVHlIyC6-Kyymw0hGXXDicMSHE,5403
50
50
  tinybird/tb/modules/mock.py,sha256=rHJtbxIKpwnWcSK4nqb-tFlObmyn2G7hR7LNw3aeFWs,5321
@@ -82,8 +82,8 @@ tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4
82
82
  tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
83
83
  tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
84
84
  tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
85
- tinybird-0.0.1.dev235.dist-info/METADATA,sha256=bqFXMTlHLyOTGGaRSBujVPJu530jgHjhfAVGQz4KpCk,1682
86
- tinybird-0.0.1.dev235.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
87
- tinybird-0.0.1.dev235.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
88
- tinybird-0.0.1.dev235.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
89
- tinybird-0.0.1.dev235.dist-info/RECORD,,
85
+ tinybird-0.0.1.dev237.dist-info/METADATA,sha256=Wx48Mkja_8CCOe1o8FJFVlz9M36gjsZHPKZK86YVQDo,1682
86
+ tinybird-0.0.1.dev237.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
87
+ tinybird-0.0.1.dev237.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
88
+ tinybird-0.0.1.dev237.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
89
+ tinybird-0.0.1.dev237.dist-info/RECORD,,