tinybird 0.0.1.dev146__py3-none-any.whl → 0.0.1.dev147__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/cicd.py +2 -0
- tinybird/tb/modules/local_common.py +11 -9
- {tinybird-0.0.1.dev146.dist-info → tinybird-0.0.1.dev147.dist-info}/METADATA +1 -1
- {tinybird-0.0.1.dev146.dist-info → tinybird-0.0.1.dev147.dist-info}/RECORD +8 -8
- {tinybird-0.0.1.dev146.dist-info → tinybird-0.0.1.dev147.dist-info}/WHEEL +0 -0
- {tinybird-0.0.1.dev146.dist-info → tinybird-0.0.1.dev147.dist-info}/entry_points.txt +0 -0
- {tinybird-0.0.1.dev146.dist-info → tinybird-0.0.1.dev147.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/cli/introduction.html'
|
|
5
5
|
__author__ = 'Tinybird'
|
|
6
6
|
__author_email__ = 'support@tinybird.co'
|
|
7
|
-
__version__ = '0.0.1.
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '0.0.1.dev147'
|
|
8
|
+
__revision__ = 'c9f089b'
|
tinybird/tb/modules/cicd.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import hashlib
|
|
2
2
|
import logging
|
|
3
3
|
import os
|
|
4
|
+
import re
|
|
4
5
|
from typing import Any, Dict
|
|
5
6
|
|
|
6
7
|
import requests
|
|
@@ -13,14 +14,15 @@ from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
|
13
14
|
TB_IMAGE_NAME = "tinybirdco/tinybird-local:latest"
|
|
14
15
|
TB_CONTAINER_NAME = "tinybird-local"
|
|
15
16
|
TB_LOCAL_PORT = int(os.getenv("TB_LOCAL_PORT", 7181))
|
|
16
|
-
TB_LOCAL_HOST =
|
|
17
|
+
TB_LOCAL_HOST = re.sub(r"^https?://", "", os.getenv("TB_LOCAL_HOST", "localhost"))
|
|
18
|
+
TB_LOCAL_ADDRESS = f"http://{TB_LOCAL_HOST}:{TB_LOCAL_PORT}"
|
|
17
19
|
|
|
18
20
|
|
|
19
21
|
async def get_tinybird_local_client(config_obj: Dict[str, Any], staging: bool = False) -> TinyB:
|
|
20
22
|
"""Get a Tinybird client connected to the local environment."""
|
|
21
23
|
|
|
22
24
|
config = await get_tinybird_local_config(config_obj)
|
|
23
|
-
return config.get_client(host=
|
|
25
|
+
return config.get_client(host=TB_LOCAL_ADDRESS, staging=staging)
|
|
24
26
|
|
|
25
27
|
|
|
26
28
|
async def get_tinybird_local_config(config_obj: Dict[str, Any]) -> CLIConfig:
|
|
@@ -33,7 +35,7 @@ async def get_tinybird_local_config(config_obj: Dict[str, Any]) -> CLIConfig:
|
|
|
33
35
|
|
|
34
36
|
try:
|
|
35
37
|
# ruff: noqa: ASYNC210
|
|
36
|
-
tokens = requests.get(f"{
|
|
38
|
+
tokens = requests.get(f"{TB_LOCAL_ADDRESS}/tokens").json()
|
|
37
39
|
except Exception:
|
|
38
40
|
raise CLILocalException(
|
|
39
41
|
FeedbackManager.error(message="Tinybird local is not running. Please run `tb local start` first.")
|
|
@@ -44,7 +46,7 @@ async def get_tinybird_local_config(config_obj: Dict[str, Any]) -> CLIConfig:
|
|
|
44
46
|
default_token = tokens["workspace_admin_token"]
|
|
45
47
|
# Create a new workspace if path is provided. This is used to isolate the build in a different workspace.
|
|
46
48
|
if path:
|
|
47
|
-
user_client = config.get_client(host=
|
|
49
|
+
user_client = config.get_client(host=TB_LOCAL_ADDRESS, token=user_token)
|
|
48
50
|
ws_name = config.get("name") or config_obj.get("name") or get_build_workspace_name(path)
|
|
49
51
|
if not ws_name:
|
|
50
52
|
raise AuthNoTokenException()
|
|
@@ -52,7 +54,7 @@ async def get_tinybird_local_config(config_obj: Dict[str, Any]) -> CLIConfig:
|
|
|
52
54
|
logging.debug(f"Workspace used for build: {ws_name}")
|
|
53
55
|
|
|
54
56
|
user_workspaces = requests.get(
|
|
55
|
-
f"{
|
|
57
|
+
f"{TB_LOCAL_ADDRESS}/v1/user/workspaces?with_organization=true&token={admin_token}"
|
|
56
58
|
).json()
|
|
57
59
|
user_org_id = user_workspaces.get("organization_id", {})
|
|
58
60
|
local_workspaces = user_workspaces.get("workspaces", [])
|
|
@@ -63,7 +65,7 @@ async def get_tinybird_local_config(config_obj: Dict[str, Any]) -> CLIConfig:
|
|
|
63
65
|
await user_client.create_workspace(
|
|
64
66
|
ws_name, template=None, assign_to_organization_id=user_org_id, version="v1"
|
|
65
67
|
)
|
|
66
|
-
user_workspaces = requests.get(f"{
|
|
68
|
+
user_workspaces = requests.get(f"{TB_LOCAL_ADDRESS}/v1/user/workspaces?token={admin_token}").json()
|
|
67
69
|
ws = next((ws for ws in user_workspaces["workspaces"] if ws["name"] == ws_name), None)
|
|
68
70
|
if not ws:
|
|
69
71
|
raise AuthNoTokenException()
|
|
@@ -71,11 +73,11 @@ async def get_tinybird_local_config(config_obj: Dict[str, Any]) -> CLIConfig:
|
|
|
71
73
|
ws_token = ws["token"]
|
|
72
74
|
|
|
73
75
|
config.set_token(ws_token)
|
|
74
|
-
config.set_token_for_host(
|
|
75
|
-
config.set_host(
|
|
76
|
+
config.set_token_for_host(TB_LOCAL_ADDRESS, ws_token)
|
|
77
|
+
config.set_host(TB_LOCAL_ADDRESS)
|
|
76
78
|
else:
|
|
77
79
|
config.set_token(default_token)
|
|
78
|
-
config.set_token_for_host(
|
|
80
|
+
config.set_token_for_host(TB_LOCAL_ADDRESS, default_token)
|
|
79
81
|
|
|
80
82
|
config.set_user_token(user_token)
|
|
81
83
|
return config
|
|
@@ -12,14 +12,14 @@ 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=BZuPM7MFS7vaEKK5tOMR2bwSAgJudPrJt27uVEwZmTY,40512
|
|
15
|
-
tinybird/tb/__cli__.py,sha256=
|
|
15
|
+
tinybird/tb/__cli__.py,sha256=y5e2Tv-AjplQMyc8awKNZamGGJ7WtoK-0TMjVOUziXs,252
|
|
16
16
|
tinybird/tb/check_pypi.py,sha256=rW4QmDRbtgKdUUwJCnBkVjmTjZSZGN-XgZhx7vMkC0w,1009
|
|
17
17
|
tinybird/tb/cli.py,sha256=uPV6pvi4aYVfaiGs0DQO-eoi1g9dHlrgvhutkXkdJko,1075
|
|
18
18
|
tinybird/tb/client.py,sha256=aaPKq5C77e72kR7IMv9WrvnvNki8mKMOTi9EsCp0eUc,55962
|
|
19
19
|
tinybird/tb/config.py,sha256=jT9xndpeCY_g0HdB5qE2EquC0TFRRnkPnQFWZWd04jo,3998
|
|
20
20
|
tinybird/tb/modules/auth.py,sha256=_OeYnmTH83lnqCgQEdS6K0bx1KBUeRmZk2M7JnRmWpk,9037
|
|
21
21
|
tinybird/tb/modules/build.py,sha256=5SX59ssq0KaRrgzk21KmYUnB6xOdQ_O59n7rxFBQQ1Y,17393
|
|
22
|
-
tinybird/tb/modules/cicd.py,sha256=
|
|
22
|
+
tinybird/tb/modules/cicd.py,sha256=Cn1DyE28w2maQgIJF4IjZU7J7ULPvMG11DjN2OH-cqE,7161
|
|
23
23
|
tinybird/tb/modules/cli.py,sha256=V8fC0GLt5HWtOTk6TOZM5xUAY9PoH05kyJxE6Zu4MT4,14075
|
|
24
24
|
tinybird/tb/modules/common.py,sha256=WzF_zRtAl3FKqbzK6yi_IjeeGIjQNu6SKnP-PX-o3Kk,85196
|
|
25
25
|
tinybird/tb/modules/config.py,sha256=ziqW_t_mRVvWOd85VoB4vKyvgMkEfpXDf9H4v38p2xc,11422
|
|
@@ -37,7 +37,7 @@ tinybird/tb/modules/job.py,sha256=n4dSSBgnA8NqD7srGahf2xRj6wxkmX9Vl0J-QJ_a2w0,29
|
|
|
37
37
|
tinybird/tb/modules/llm.py,sha256=KfsCYmKeW1VQz0iDZhGKCRkQv_Y3kTHh6JuxvofOguE,1076
|
|
38
38
|
tinybird/tb/modules/llm_utils.py,sha256=nS9r4FAElJw8yXtmdYrx-rtI2zXR8qXfi1QqUDCfxvg,3469
|
|
39
39
|
tinybird/tb/modules/local.py,sha256=kxdF8NXZYYwtUwlFHxHKq_PA9CpMrG-rXOg_i_hlvnY,12158
|
|
40
|
-
tinybird/tb/modules/local_common.py,sha256=
|
|
40
|
+
tinybird/tb/modules/local_common.py,sha256=3nxGcjdxA5Uq0PakhbkiPDVzd66OUwPNW4gNqyYPCe8,3381
|
|
41
41
|
tinybird/tb/modules/login.py,sha256=fmXPSdvJnKPv03chptGuu3_Fm6LhP6kUsUKhrmT8rJc,8269
|
|
42
42
|
tinybird/tb/modules/logout.py,sha256=ULooy1cDBD02-r7voZmhV7udA0ML5tVuflJyShrh56Y,1022
|
|
43
43
|
tinybird/tb/modules/materialization.py,sha256=QJX5kCPhhm6IXBO1JsalVfbQdypCe_eOUDZ_WHJZWS8,5478
|
|
@@ -79,8 +79,8 @@ tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4
|
|
|
79
79
|
tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
|
|
80
80
|
tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
|
|
81
81
|
tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
|
|
82
|
-
tinybird-0.0.1.
|
|
83
|
-
tinybird-0.0.1.
|
|
84
|
-
tinybird-0.0.1.
|
|
85
|
-
tinybird-0.0.1.
|
|
86
|
-
tinybird-0.0.1.
|
|
82
|
+
tinybird-0.0.1.dev147.dist-info/METADATA,sha256=-TJHZrxsIFnBCl47t7WdjGLoOHyNmH0Mz2zwbTR8tV4,1612
|
|
83
|
+
tinybird-0.0.1.dev147.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
84
|
+
tinybird-0.0.1.dev147.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
|
|
85
|
+
tinybird-0.0.1.dev147.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
|
|
86
|
+
tinybird-0.0.1.dev147.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|