tinybird 0.0.1.dev200__py3-none-any.whl → 0.0.1.dev201__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 +2 -2
- tinybird/tb/modules/build.py +11 -0
- tinybird/tb/modules/connection.py +7 -7
- tinybird/tb/modules/create.py +16 -0
- tinybird/tb/modules/secret.py +10 -1
- tinybird/tb/modules/watch.py +10 -1
- {tinybird-0.0.1.dev200.dist-info → tinybird-0.0.1.dev201.dist-info}/METADATA +1 -1
- {tinybird-0.0.1.dev200.dist-info → tinybird-0.0.1.dev201.dist-info}/RECORD +11 -11
- {tinybird-0.0.1.dev200.dist-info → tinybird-0.0.1.dev201.dist-info}/WHEEL +0 -0
- {tinybird-0.0.1.dev200.dist-info → tinybird-0.0.1.dev201.dist-info}/entry_points.txt +0 -0
- {tinybird-0.0.1.dev200.dist-info → tinybird-0.0.1.dev201.dist-info}/top_level.txt +0 -0
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.
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '0.0.1.dev201'
|
|
8
|
+
__revision__ = '8d22235'
|
tinybird/tb/modules/build.py
CHANGED
|
@@ -306,8 +306,19 @@ def process(
|
|
|
306
306
|
build_status.building = True
|
|
307
307
|
if file_changed and (file_changed.endswith(FixtureExtension.NDJSON) or file_changed.endswith(FixtureExtension.CSV)):
|
|
308
308
|
rebuild_fixture(project, tb_client, file_changed)
|
|
309
|
+
if build_status:
|
|
310
|
+
build_status.building = False
|
|
311
|
+
build_status.error = None
|
|
309
312
|
elif file_changed and file_changed.endswith(".sql"):
|
|
310
313
|
rebuild_fixture_sql(project, tb_client, file_changed)
|
|
314
|
+
if build_status:
|
|
315
|
+
build_status.building = False
|
|
316
|
+
build_status.error = None
|
|
317
|
+
elif file_changed and (file_changed.endswith(".env.local") or file_changed.endswith(".env")):
|
|
318
|
+
load_secrets(project, tb_client)
|
|
319
|
+
if build_status:
|
|
320
|
+
build_status.building = False
|
|
321
|
+
build_status.error = None
|
|
311
322
|
else:
|
|
312
323
|
try:
|
|
313
324
|
build_result = build_project(project, tb_client, silent)
|
|
@@ -38,6 +38,7 @@ from tinybird.tb.modules.create import (
|
|
|
38
38
|
from tinybird.tb.modules.exceptions import CLIConnectionException
|
|
39
39
|
from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
40
40
|
from tinybird.tb.modules.project import Project
|
|
41
|
+
from tinybird.tb.modules.secret import save_secret_to_env_file
|
|
41
42
|
|
|
42
43
|
DATA_CONNECTOR_SETTINGS: Dict[DataConnectorType, List[str]] = {
|
|
43
44
|
DataConnectorType.KAFKA: [
|
|
@@ -356,7 +357,6 @@ async def connection_create_kafka(
|
|
|
356
357
|
security_protocol="SASL_SSL",
|
|
357
358
|
skip_secrets=False,
|
|
358
359
|
) -> Tuple[str, str, str, str, str, str, str, str, List[str]]:
|
|
359
|
-
client: TinyB = ctx.ensure_object(dict)["client"]
|
|
360
360
|
obj: Dict[str, Any] = ctx.ensure_object(dict)
|
|
361
361
|
click.echo(FeedbackManager.gray(message="\n» Creating Kafka connection..."))
|
|
362
362
|
project: Project = ctx.ensure_object(dict)["project"]
|
|
@@ -374,7 +374,7 @@ async def connection_create_kafka(
|
|
|
374
374
|
|
|
375
375
|
validate_kafka_bootstrap_servers(bootstrap_servers)
|
|
376
376
|
secret_required = not skip_secrets and click.confirm(
|
|
377
|
-
FeedbackManager.highlight(message=" ? Do you want to store the bootstrap server in a
|
|
377
|
+
FeedbackManager.highlight(message=" ? Do you want to store the bootstrap server in a .env.local file? [Y/n]"),
|
|
378
378
|
default=True,
|
|
379
379
|
show_default=False,
|
|
380
380
|
)
|
|
@@ -385,7 +385,7 @@ async def connection_create_kafka(
|
|
|
385
385
|
if secret_required:
|
|
386
386
|
tb_secret_bootstrap_servers = str(click.prompt(FeedbackManager.highlight(message=" ? Secret name")))
|
|
387
387
|
try:
|
|
388
|
-
|
|
388
|
+
save_secret_to_env_file(project=project, name=tb_secret_bootstrap_servers, value=bootstrap_servers)
|
|
389
389
|
except Exception as e:
|
|
390
390
|
raise CLIConnectionException(FeedbackManager.error(message=str(e)))
|
|
391
391
|
|
|
@@ -395,7 +395,7 @@ async def connection_create_kafka(
|
|
|
395
395
|
validate_kafka_key(key)
|
|
396
396
|
|
|
397
397
|
secret_required = not skip_secrets and click.confirm(
|
|
398
|
-
FeedbackManager.highlight(message=" ? Do you want to store the Kafka key in a
|
|
398
|
+
FeedbackManager.highlight(message=" ? Do you want to store the Kafka key in a .env.local file? [Y/n]"),
|
|
399
399
|
default=True,
|
|
400
400
|
show_default=False,
|
|
401
401
|
)
|
|
@@ -403,7 +403,7 @@ async def connection_create_kafka(
|
|
|
403
403
|
if secret_required:
|
|
404
404
|
tb_secret_key = str(click.prompt(FeedbackManager.highlight(message=" ? Secret name")))
|
|
405
405
|
try:
|
|
406
|
-
|
|
406
|
+
save_secret_to_env_file(project=project, name=tb_secret_key, value=key)
|
|
407
407
|
except Exception as e:
|
|
408
408
|
raise CLIConnectionException(FeedbackManager.error(message=str(e)))
|
|
409
409
|
|
|
@@ -413,7 +413,7 @@ async def connection_create_kafka(
|
|
|
413
413
|
validate_kafka_secret(secret)
|
|
414
414
|
|
|
415
415
|
secret_required = not skip_secrets and click.confirm(
|
|
416
|
-
FeedbackManager.highlight(message=" ? Do you want to store the Kafka secret in a
|
|
416
|
+
FeedbackManager.highlight(message=" ? Do you want to store the Kafka secret in a .env.local file? [Y/n]"),
|
|
417
417
|
default=True,
|
|
418
418
|
show_default=False,
|
|
419
419
|
)
|
|
@@ -421,7 +421,7 @@ async def connection_create_kafka(
|
|
|
421
421
|
if secret_required:
|
|
422
422
|
tb_secret_secret = str(click.prompt(FeedbackManager.highlight(message=" ? Secret name")))
|
|
423
423
|
try:
|
|
424
|
-
|
|
424
|
+
save_secret_to_env_file(project=project, name=tb_secret_secret, value=secret)
|
|
425
425
|
except Exception as e:
|
|
426
426
|
raise CLIConnectionException(FeedbackManager.error(message=str(e)))
|
|
427
427
|
|
tinybird/tb/modules/create.py
CHANGED
|
@@ -124,6 +124,12 @@ async def create(
|
|
|
124
124
|
if data or prompt:
|
|
125
125
|
click.echo(FeedbackManager.success(message="✓ Resources created!\n"))
|
|
126
126
|
|
|
127
|
+
if not already_has_env_file(root_folder):
|
|
128
|
+
click.echo(FeedbackManager.highlight(message="\n» Creating .env.local file..."))
|
|
129
|
+
create_env_file(root_folder)
|
|
130
|
+
click.echo(FeedbackManager.success(message="✓ Done!\n"))
|
|
131
|
+
created_something = True
|
|
132
|
+
|
|
127
133
|
if not already_has_cicd(root_folder):
|
|
128
134
|
click.echo(FeedbackManager.highlight(message="\n» Creating CI/CD files for GitHub and GitLab..."))
|
|
129
135
|
init_git(root_folder)
|
|
@@ -230,6 +236,11 @@ def already_has_cursor_rules(folder: str) -> bool:
|
|
|
230
236
|
return any((Path(folder) / path).exists() for path in cursor_rules_paths)
|
|
231
237
|
|
|
232
238
|
|
|
239
|
+
def already_has_env_file(folder: str) -> bool:
|
|
240
|
+
env_file_pattern = ".env.*"
|
|
241
|
+
return any((Path(folder) / path).exists() for path in glob.glob(env_file_pattern))
|
|
242
|
+
|
|
243
|
+
|
|
233
244
|
def create_project_structure(folder: str):
|
|
234
245
|
folder_path = Path(folder)
|
|
235
246
|
PROJECT_PATHS_DESCRIPTIONS = {
|
|
@@ -433,6 +444,11 @@ GCS_SERVICE_ACCOUNT_CREDENTIALS_JSON {{{{ tb_secret("{svc_account_creds}") }}}}
|
|
|
433
444
|
return file_path
|
|
434
445
|
|
|
435
446
|
|
|
447
|
+
def create_env_file(folder: str):
|
|
448
|
+
env_file = Path(folder) / ".env.local"
|
|
449
|
+
env_file.write_text("")
|
|
450
|
+
|
|
451
|
+
|
|
436
452
|
def create_rules(folder: str, source: str, agent: str):
|
|
437
453
|
if agent == "cursor":
|
|
438
454
|
extension = ".cursorrules"
|
tinybird/tb/modules/secret.py
CHANGED
|
@@ -2,7 +2,7 @@ import re
|
|
|
2
2
|
from typing import Dict, Optional
|
|
3
3
|
|
|
4
4
|
import click
|
|
5
|
-
from dotenv import dotenv_values
|
|
5
|
+
from dotenv import dotenv_values, set_key
|
|
6
6
|
|
|
7
7
|
from tinybird.syncasync import async_to_sync
|
|
8
8
|
from tinybird.tb.client import TinyB
|
|
@@ -137,3 +137,12 @@ def load_secrets(project: Project, client: TinyB):
|
|
|
137
137
|
click.echo(FeedbackManager.success(message="✓ Secrets loaded!"))
|
|
138
138
|
except Exception as e:
|
|
139
139
|
click.echo(FeedbackManager.error(message=f"✗ Error: {e}"))
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def save_secret_to_env_file(project: Project, name: str, value: str):
|
|
143
|
+
env_path = project.path / ".env.local"
|
|
144
|
+
|
|
145
|
+
if not env_path.exists():
|
|
146
|
+
env_path.touch()
|
|
147
|
+
|
|
148
|
+
set_key(env_path, key_to_set=name, value_to_set=value)
|
tinybird/tb/modules/watch.py
CHANGED
|
@@ -23,7 +23,16 @@ from tinybird.tb.modules.shell import Shell
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
class WatchProjectHandler(PatternMatchingEventHandler):
|
|
26
|
-
valid_extensions = [
|
|
26
|
+
valid_extensions = [
|
|
27
|
+
".datasource",
|
|
28
|
+
".pipe",
|
|
29
|
+
"connection",
|
|
30
|
+
FixtureExtension.CSV,
|
|
31
|
+
FixtureExtension.NDJSON,
|
|
32
|
+
".sql",
|
|
33
|
+
".env",
|
|
34
|
+
".env.local",
|
|
35
|
+
]
|
|
27
36
|
|
|
28
37
|
def __init__(self, shell: Shell, project: Project, process: Callable):
|
|
29
38
|
self.shell = shell
|
|
@@ -12,19 +12,19 @@ tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
|
|
|
12
12
|
tinybird/tornado_template.py,sha256=jjNVDMnkYFWXflmT8KU_Ssbo5vR8KQq3EJMk5vYgXRw,41959
|
|
13
13
|
tinybird/ch_utils/constants.py,sha256=aYvg2C_WxYWsnqPdZB1ZFoIr8ZY-XjUXYyHKE9Ansj0,3890
|
|
14
14
|
tinybird/ch_utils/engine.py,sha256=X4tE9OrfaUy6kO9cqVEzyI9cDcmOF3IAssRRzsTsfEQ,40781
|
|
15
|
-
tinybird/tb/__cli__.py,sha256=
|
|
15
|
+
tinybird/tb/__cli__.py,sha256=QzXsIBDUzyBxF8NSse739XY7vXXrMJajH06eRENwL3k,247
|
|
16
16
|
tinybird/tb/check_pypi.py,sha256=rW4QmDRbtgKdUUwJCnBkVjmTjZSZGN-XgZhx7vMkC0w,1009
|
|
17
17
|
tinybird/tb/cli.py,sha256=u3eGOhX0MHkuT6tiwaZ0_3twqLmqKXDAOxF7yV_Nn9Q,1075
|
|
18
18
|
tinybird/tb/client.py,sha256=CO-dQw8h28X6T6IO-Z79yPBKaJQT1Rwya5b6gexvw58,56491
|
|
19
19
|
tinybird/tb/config.py,sha256=jT9xndpeCY_g0HdB5qE2EquC0TFRRnkPnQFWZWd04jo,3998
|
|
20
|
-
tinybird/tb/modules/build.py,sha256=
|
|
20
|
+
tinybird/tb/modules/build.py,sha256=96J_n8IWYPLN0JORPb6QXgT4-3JXw4JSXmAtzQcqN7E,19951
|
|
21
21
|
tinybird/tb/modules/cicd.py,sha256=Njb6eZOHHbUkoJJx6KoixO9PsfA_T-3Ybkya9-50Ca8,7328
|
|
22
22
|
tinybird/tb/modules/cli.py,sha256=qmD1tNoPXxpDuTD_Vu4YIR9egc3m1eS0NIhaQzacOYo,15605
|
|
23
23
|
tinybird/tb/modules/common.py,sha256=R675BLZTnPlCoPphCTcy3S1lsf1MF_H3U_ox9yPNCqg,84187
|
|
24
24
|
tinybird/tb/modules/config.py,sha256=ziqW_t_mRVvWOd85VoB4vKyvgMkEfpXDf9H4v38p2xc,11422
|
|
25
|
-
tinybird/tb/modules/connection.py,sha256=
|
|
25
|
+
tinybird/tb/modules/connection.py,sha256=p585QPjhMpLeRpgFW8mP1Xvw2mUE7ypn37zxkfcRdAA,17797
|
|
26
26
|
tinybird/tb/modules/copy.py,sha256=2Mm4FWKehOG7CoOhiF1m9UZJgJn0W1_cMolqju8ONYg,5805
|
|
27
|
-
tinybird/tb/modules/create.py,sha256=
|
|
27
|
+
tinybird/tb/modules/create.py,sha256=sncG6iaeS_AApY1EmmfYEdj9B6-1CPZJzvTmfJQj_Rc,22112
|
|
28
28
|
tinybird/tb/modules/datasource.py,sha256=qbASM0g49JK8LCFy12g18DdAPOJ-mdfWCCfg8Fhu-ME,38450
|
|
29
29
|
tinybird/tb/modules/deployment.py,sha256=QeLYvk6vNmOFC2FAvhR5tzFIYDkSCVgT08CGEIxr4fU,28154
|
|
30
30
|
tinybird/tb/modules/deprecations.py,sha256=rrszC1f_JJeJ8mUxGoCxckQTJFBCR8wREf4XXXN-PRc,4507
|
|
@@ -47,13 +47,13 @@ tinybird/tb/modules/open.py,sha256=OuctINN77oexpSjth9uoIZPCelKO4Li-yyVxeSnk1io,1
|
|
|
47
47
|
tinybird/tb/modules/pipe.py,sha256=AQKEDagO6e3psPVjJkS_MDbn8aK-apAiLp26k7jgAV0,2432
|
|
48
48
|
tinybird/tb/modules/project.py,sha256=xaXzLytWieNvSfK8DRvFJMXWxVNTAp4mI7Jkvozauoc,5599
|
|
49
49
|
tinybird/tb/modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
|
|
50
|
-
tinybird/tb/modules/secret.py,sha256=
|
|
50
|
+
tinybird/tb/modules/secret.py,sha256=jw1DIDKmS1L1U-y7LRYo65sVSGuRcpIHGo5CNiKHjo4,4945
|
|
51
51
|
tinybird/tb/modules/shell.py,sha256=Zd_4Ak_5tKVX-cw6B4ag36xZeEGHeh-jZpAsIXkoMoE,14116
|
|
52
52
|
tinybird/tb/modules/table.py,sha256=4XrtjM-N0zfNtxVkbvLDQQazno1EPXnxTyo7llivfXk,11035
|
|
53
53
|
tinybird/tb/modules/telemetry.py,sha256=X0p5AVkM8BNsK_Rhdcg4p2eIf6OHimHO_VLldBqHQ8o,11386
|
|
54
54
|
tinybird/tb/modules/test.py,sha256=XakpYi0Q2gGKItpPdtRVLKzQldkvCPqzPhwwbUxyrmc,13292
|
|
55
55
|
tinybird/tb/modules/token.py,sha256=2fmKwu10_M0pqs6YmJVeILR9ZQB0ejRAET86agASbKM,13488
|
|
56
|
-
tinybird/tb/modules/watch.py,sha256=
|
|
56
|
+
tinybird/tb/modules/watch.py,sha256=tkt2s8CLxBvB9Ty7YVgdh4wBTWIisZA5pstZTG7sZy8,8976
|
|
57
57
|
tinybird/tb/modules/workspace.py,sha256=WDi3Vu9t60b4Ht5vbPsakUErFmsECtFRcfXb1l300xc,11057
|
|
58
58
|
tinybird/tb/modules/workspace_members.py,sha256=RYLpyPM1ECCasHRg3uvpckzXplX0_KgNFsSPZn_i6qk,8744
|
|
59
59
|
tinybird/tb/modules/datafile/build.py,sha256=MTzX8gWlxHov9C8c1PduyDDsp1dxxWSl26mCVyTvJPg,51395
|
|
@@ -80,8 +80,8 @@ tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4
|
|
|
80
80
|
tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
|
|
81
81
|
tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
|
|
82
82
|
tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
|
|
83
|
-
tinybird-0.0.1.
|
|
84
|
-
tinybird-0.0.1.
|
|
85
|
-
tinybird-0.0.1.
|
|
86
|
-
tinybird-0.0.1.
|
|
87
|
-
tinybird-0.0.1.
|
|
83
|
+
tinybird-0.0.1.dev201.dist-info/METADATA,sha256=HhvMItwC-QhVJ_z_1fLJQgiiK3f8q6zAWzxDi3JUpu8,1682
|
|
84
|
+
tinybird-0.0.1.dev201.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
85
|
+
tinybird-0.0.1.dev201.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
|
|
86
|
+
tinybird-0.0.1.dev201.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
|
|
87
|
+
tinybird-0.0.1.dev201.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|