tinybird 0.0.1.dev199__py3-none-any.whl → 0.0.1.dev200__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 +4 -0
- tinybird/tb/modules/secret.py +52 -1
- tinybird/tb/modules/test.py +4 -0
- {tinybird-0.0.1.dev199.dist-info → tinybird-0.0.1.dev200.dist-info}/METADATA +2 -1
- {tinybird-0.0.1.dev199.dist-info → tinybird-0.0.1.dev200.dist-info}/RECORD +9 -9
- {tinybird-0.0.1.dev199.dist-info → tinybird-0.0.1.dev200.dist-info}/WHEEL +0 -0
- {tinybird-0.0.1.dev199.dist-info → tinybird-0.0.1.dev200.dist-info}/entry_points.txt +0 -0
- {tinybird-0.0.1.dev199.dist-info → tinybird-0.0.1.dev200.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.dev200'
|
|
8
|
+
__revision__ = '1cfd3bf'
|
tinybird/tb/modules/build.py
CHANGED
|
@@ -25,6 +25,7 @@ from tinybird.tb.modules.datafile.playground import folder_playground
|
|
|
25
25
|
from tinybird.tb.modules.dev_server import BuildStatus, start_server
|
|
26
26
|
from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
27
27
|
from tinybird.tb.modules.project import Project
|
|
28
|
+
from tinybird.tb.modules.secret import load_secrets
|
|
28
29
|
from tinybird.tb.modules.shell import Shell, print_table_formatted
|
|
29
30
|
from tinybird.tb.modules.watch import watch_files, watch_project
|
|
30
31
|
|
|
@@ -47,6 +48,7 @@ def build(ctx: click.Context, watch: bool) -> None:
|
|
|
47
48
|
)
|
|
48
49
|
)
|
|
49
50
|
|
|
51
|
+
load_secrets(project, tb_client)
|
|
50
52
|
click.echo(FeedbackManager.highlight_building_project())
|
|
51
53
|
process(project=project, tb_client=tb_client, watch=False)
|
|
52
54
|
if watch:
|
|
@@ -74,6 +76,8 @@ def dev(ctx: click.Context, data_origin: str, ui: bool) -> None:
|
|
|
74
76
|
server_thread.start()
|
|
75
77
|
# Wait for the server to start
|
|
76
78
|
time.sleep(0.5)
|
|
79
|
+
|
|
80
|
+
load_secrets(project, tb_client)
|
|
77
81
|
click.echo(FeedbackManager.highlight_building_project())
|
|
78
82
|
process(project=project, tb_client=tb_client, watch=True, build_status=build_status)
|
|
79
83
|
run_watch(
|
tinybird/tb/modules/secret.py
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import re
|
|
2
|
-
from typing import Optional
|
|
2
|
+
from typing import Dict, Optional
|
|
3
3
|
|
|
4
4
|
import click
|
|
5
|
+
from dotenv import dotenv_values
|
|
5
6
|
|
|
7
|
+
from tinybird.syncasync import async_to_sync
|
|
6
8
|
from tinybird.tb.client import TinyB
|
|
7
9
|
from tinybird.tb.modules.cli import cli
|
|
8
10
|
from tinybird.tb.modules.common import coro, echo_safe_humanfriendly_tables_format_smart_table
|
|
9
11
|
from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
12
|
+
from tinybird.tb.modules.project import Project
|
|
10
13
|
|
|
11
14
|
|
|
12
15
|
@cli.group()
|
|
@@ -86,3 +89,51 @@ async def secret_rm(ctx: click.Context, name: str):
|
|
|
86
89
|
click.echo(FeedbackManager.success(message=f"\n✓ Secret '{name}' deleted"))
|
|
87
90
|
except Exception as e:
|
|
88
91
|
click.echo(FeedbackManager.error(message=f"✗ Error: {e}"))
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def load_secrets(project: Project, client: TinyB):
|
|
95
|
+
try:
|
|
96
|
+
env_vars: Dict[str, str] = {}
|
|
97
|
+
|
|
98
|
+
# Load secrets from .env file
|
|
99
|
+
env_file = ".env"
|
|
100
|
+
env_path = project.path / env_file
|
|
101
|
+
|
|
102
|
+
if env_path.exists():
|
|
103
|
+
env_values = dotenv_values(env_path)
|
|
104
|
+
if env_values:
|
|
105
|
+
env_vars.update({k: v for k, v in env_values.items() if v is not None})
|
|
106
|
+
|
|
107
|
+
# Load secrets from .env.local file
|
|
108
|
+
env_file = ".env.local"
|
|
109
|
+
env_path = project.path / env_file
|
|
110
|
+
|
|
111
|
+
if env_path.exists():
|
|
112
|
+
env_values = dotenv_values(env_path)
|
|
113
|
+
if env_values:
|
|
114
|
+
env_vars.update({k: v for k, v in env_values.items() if v is not None})
|
|
115
|
+
|
|
116
|
+
if len(env_vars.keys()) == 0:
|
|
117
|
+
return
|
|
118
|
+
|
|
119
|
+
click.echo(FeedbackManager.highlight(message="\n» Loading secrets from .env files..."))
|
|
120
|
+
|
|
121
|
+
for name, value in env_vars.items():
|
|
122
|
+
if not value:
|
|
123
|
+
continue
|
|
124
|
+
|
|
125
|
+
try:
|
|
126
|
+
existing_secret = async_to_sync(client.get_secret)(name)
|
|
127
|
+
except Exception:
|
|
128
|
+
existing_secret = None
|
|
129
|
+
try:
|
|
130
|
+
if existing_secret:
|
|
131
|
+
async_to_sync(client.update_secret)(name, value)
|
|
132
|
+
else:
|
|
133
|
+
async_to_sync(client.create_secret)(name, value)
|
|
134
|
+
except Exception as e:
|
|
135
|
+
click.echo(FeedbackManager.error(message=f"✗ Error setting secret '{name}': {e}"))
|
|
136
|
+
|
|
137
|
+
click.echo(FeedbackManager.success(message="✓ Secrets loaded!"))
|
|
138
|
+
except Exception as e:
|
|
139
|
+
click.echo(FeedbackManager.error(message=f"✗ Error: {e}"))
|
tinybird/tb/modules/test.py
CHANGED
|
@@ -27,6 +27,7 @@ from tinybird.tb.modules.llm import LLM
|
|
|
27
27
|
from tinybird.tb.modules.llm_utils import extract_xml, parse_xml
|
|
28
28
|
from tinybird.tb.modules.local_common import get_local_tokens, get_test_workspace_name
|
|
29
29
|
from tinybird.tb.modules.project import Project
|
|
30
|
+
from tinybird.tb.modules.secret import load_secrets
|
|
30
31
|
|
|
31
32
|
yaml.SafeDumper.org_represent_str = yaml.SafeDumper.represent_str # type: ignore[attr-defined]
|
|
32
33
|
|
|
@@ -78,6 +79,7 @@ def test_create(ctx: click.Context, name_or_filename: str, prompt: str) -> None:
|
|
|
78
79
|
try:
|
|
79
80
|
project: Project = ctx.ensure_object(dict)["project"]
|
|
80
81
|
client: TinyB = ctx.ensure_object(dict)["client"]
|
|
82
|
+
load_secrets(project=project, client=client)
|
|
81
83
|
click.echo(FeedbackManager.highlight(message="\n» Building project"))
|
|
82
84
|
build_project(project=project, tb_client=client, watch=False, silent=True)
|
|
83
85
|
click.echo(FeedbackManager.info(message="✓ Done!\n"))
|
|
@@ -156,6 +158,7 @@ def test_update(ctx: click.Context, pipe: str) -> None:
|
|
|
156
158
|
client: TinyB = ctx.ensure_object(dict)["client"]
|
|
157
159
|
project: Project = ctx.ensure_object(dict)["project"]
|
|
158
160
|
folder = project.folder
|
|
161
|
+
load_secrets(project=project, client=client)
|
|
159
162
|
click.echo(FeedbackManager.highlight(message="\n» Building project"))
|
|
160
163
|
build_project(project=project, tb_client=client, watch=False, silent=True)
|
|
161
164
|
click.echo(FeedbackManager.info(message="✓ Done!"))
|
|
@@ -208,6 +211,7 @@ def run_tests(ctx: click.Context, name: Tuple[str, ...]) -> None:
|
|
|
208
211
|
try:
|
|
209
212
|
client: TinyB = ctx.ensure_object(dict)["client"]
|
|
210
213
|
project: Project = ctx.ensure_object(dict)["project"]
|
|
214
|
+
load_secrets(project=project, client=client)
|
|
211
215
|
click.echo(FeedbackManager.highlight(message="\n» Building project"))
|
|
212
216
|
build_project(project=project, tb_client=client, watch=False, silent=True)
|
|
213
217
|
click.echo(FeedbackManager.info(message="✓ Done!"))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: tinybird
|
|
3
|
-
Version: 0.0.1.
|
|
3
|
+
Version: 0.0.1.dev200
|
|
4
4
|
Summary: Tinybird Command Line Tool
|
|
5
5
|
Home-page: https://www.tinybird.co/docs/forward/commands
|
|
6
6
|
Author: Tinybird
|
|
@@ -34,6 +34,7 @@ Requires-Dist: wheel
|
|
|
34
34
|
Requires-Dist: packaging<24,>=23.1
|
|
35
35
|
Requires-Dist: llm>=0.19
|
|
36
36
|
Requires-Dist: thefuzz==0.22.1
|
|
37
|
+
Requires-Dist: python-dotenv==1.1.0
|
|
37
38
|
Dynamic: author
|
|
38
39
|
Dynamic: author-email
|
|
39
40
|
Dynamic: description
|
|
@@ -12,12 +12,12 @@ 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=DiQBRU0k9K-SDyrntZsY1l2JRmWLeIjyAaWQBT3cB-4,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=GtIhPL60_LsHy0cVPxaNpexq66vNJF5x1QBnoOpEmGI,19497
|
|
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
|
|
@@ -47,11 +47,11 @@ 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=jjSb2dWW2neeq_lkZxRARSMiSoH88VNkDiQOi89dbeM,4705
|
|
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
|
-
tinybird/tb/modules/test.py,sha256=
|
|
54
|
+
tinybird/tb/modules/test.py,sha256=XakpYi0Q2gGKItpPdtRVLKzQldkvCPqzPhwwbUxyrmc,13292
|
|
55
55
|
tinybird/tb/modules/token.py,sha256=2fmKwu10_M0pqs6YmJVeILR9ZQB0ejRAET86agASbKM,13488
|
|
56
56
|
tinybird/tb/modules/watch.py,sha256=H1FieLTVGRqmZ0hR0vELbQJ9l0CThrFCgGCta-MPuAY,8883
|
|
57
57
|
tinybird/tb/modules/workspace.py,sha256=WDi3Vu9t60b4Ht5vbPsakUErFmsECtFRcfXb1l300xc,11057
|
|
@@ -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.dev200.dist-info/METADATA,sha256=8RxXJeb1UA6_yPuJMwgAUYHVuXeuHOF-YnkTHpoDUJ0,1682
|
|
84
|
+
tinybird-0.0.1.dev200.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
85
|
+
tinybird-0.0.1.dev200.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
|
|
86
|
+
tinybird-0.0.1.dev200.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
|
|
87
|
+
tinybird-0.0.1.dev200.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|