tinybird 0.0.1.dev105__py3-none-any.whl → 0.0.1.dev107__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.dev105'
8
- __revision__ = '43fbce5'
7
+ __version__ = '0.0.1.dev107'
8
+ __revision__ = '76708c2'
@@ -58,6 +58,33 @@ jobs:
58
58
  run: tb --cloud --host ${{! env.TINYBIRD_HOST }} --token ${{! env.TINYBIRD_TOKEN }} deploy --check
59
59
  """
60
60
 
61
+ GITHUB_CD_YML = """
62
+ name: Tinybird - CD Workflow
63
+
64
+ on:
65
+ push:
66
+ branches:
67
+ - main
68
+ - master{% if data_project_dir != '.' %}
69
+ paths:
70
+ - '{{ data_project_dir }}/**'{% end %}
71
+
72
+ concurrency: ${{! github.workflow }}-${{! github.event.ref }}
73
+
74
+ env:
75
+ TINYBIRD_HOST: ${{! secrets.TINYBIRD_HOST }}
76
+ TINYBIRD_TOKEN: ${{! secrets.TINYBIRD_TOKEN }}
77
+
78
+ jobs:
79
+ cd:
80
+ runs-on: ubuntu-latest
81
+ steps:
82
+ - uses: actions/checkout@v3
83
+ - name: Install Tinybird CLI
84
+ run: curl -LsSf https://api.tinybird.co/static/install.sh | sh
85
+ - name: Deploy project
86
+ run: tb --cloud --host ${{! env.TINYBIRD_HOST }} --token ${{! env.TINYBIRD_TOKEN }} deploy
87
+ """
61
88
 
62
89
  GITLAB_YML = """
63
90
  include:
@@ -65,6 +92,7 @@ include:
65
92
 
66
93
  stages:
67
94
  - tests
95
+ - deploy
68
96
  """
69
97
 
70
98
 
@@ -92,6 +120,22 @@ tinybird_ci_workflow:
92
120
  services:
93
121
  - name: tinybirdco/tinybird-local:beta
94
122
  alias: tinybird-local
123
+
124
+ tinybird_cd_workflow:
125
+ image: ubuntu:latest
126
+ stage: deploy
127
+ resource_group: production
128
+ needs: []
129
+ rules:
130
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
131
+ changes:
132
+ - .gitlab/tinybird/*{% if data_project_dir != '.' %}
133
+ - {{ data_project_dir }}/*
134
+ - {{ data_project_dir }}/**/*{% end %}
135
+ script:
136
+ - export PATH="$HOME/.local/bin:$PATH"
137
+ - cd $CI_PROJECT_DIR/{{ data_project_dir }}
138
+ - tb --cloud --host ${{! TINYBIRD_HOST }} --token ${{! TINYBIRD_TOKEN }} deploy
95
139
  """
96
140
 
97
141
 
@@ -153,6 +197,11 @@ class GitHubCICDGenerator(CICDGeneratorBase):
153
197
  file_name="tinybird-ci.yml",
154
198
  dir_path=".github/workflows",
155
199
  ),
200
+ CICDFile(
201
+ template=GITHUB_CD_YML,
202
+ file_name="tinybird-cd.yml",
203
+ dir_path=".github/workflows",
204
+ ),
156
205
  ]
157
206
 
158
207
 
@@ -40,7 +40,7 @@ def api_post(
40
40
  params: Optional[dict] = None,
41
41
  ) -> dict:
42
42
  r = requests.post(url, headers=headers, files=files, params=params)
43
- if r.status_code == 200:
43
+ if r.status_code < 300:
44
44
  logging.debug(json.dumps(r.json(), indent=2))
45
45
  return r.json()
46
46
  # Try to parse and print the error from the response
@@ -48,8 +48,10 @@ def api_post(
48
48
  result = r.json()
49
49
  logging.debug(json.dumps(result, indent=2))
50
50
  error = result.get("error")
51
- click.echo(FeedbackManager.error(message=f"Error: {error}"))
52
- sys.exit(1)
51
+ if error:
52
+ click.echo(FeedbackManager.error(message=f"Error: {error}"))
53
+ sys.exit(1)
54
+ return result
53
55
  except Exception:
54
56
  click.echo(FeedbackManager.error(message="Error parsing response from API"))
55
57
  sys.exit(1)
@@ -384,7 +386,7 @@ def create_deployment(
384
386
  )
385
387
  else:
386
388
  click.echo(FeedbackManager.error(message=f"{deploy_error.get('error')}"))
387
- click.echo() # For spacing
389
+ click.echo("") # For spacing
388
390
 
389
391
  status = result.get("result")
390
392
  if check:
@@ -147,6 +147,9 @@ def update_cli():
147
147
  )
148
148
  stdout, stderr = process.communicate()
149
149
  if "Nothing to upgrade" not in stdout + stderr:
150
+ for line in stdout.split("\n") + stderr.split("\n"):
151
+ if "Updated tinybird" in line:
152
+ click.echo(FeedbackManager.info(message=f"» {line}"))
150
153
  click.echo(FeedbackManager.success(message="✓ Tinybird CLI updated"))
151
154
  else:
152
155
  click.echo(FeedbackManager.info(message="✓ Tinybird CLI is already up-to-date"))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev105
3
+ Version: 0.0.1.dev107
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -15,11 +15,11 @@ tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
15
15
  tinybird/tornado_template.py,sha256=jjNVDMnkYFWXflmT8KU_Ssbo5vR8KQq3EJMk5vYgXRw,41959
16
16
  tinybird/ch_utils/constants.py,sha256=aYvg2C_WxYWsnqPdZB1ZFoIr8ZY-XjUXYyHKE9Ansj0,3890
17
17
  tinybird/ch_utils/engine.py,sha256=BZuPM7MFS7vaEKK5tOMR2bwSAgJudPrJt27uVEwZmTY,40512
18
- tinybird/tb/__cli__.py,sha256=J8wIG9O6M4ZhVNRXbeTtwTp7z2fiJvI6E10Nn4-l4LI,252
18
+ tinybird/tb/__cli__.py,sha256=t8MFy2-t9fuw6aYIBOtbd_R7b7PF-LjKaUPwssmRWnA,252
19
19
  tinybird/tb/cli.py,sha256=H_HaZhkimKgkryYXpBjHfY9Qtg-ZORiONU3psDNpzDk,1135
20
20
  tinybird/tb/modules/auth.py,sha256=L1IatO2arRSzys3t8px8xVt8uPWUL5EVD0sFzAV_uVU,9022
21
21
  tinybird/tb/modules/build.py,sha256=h5drdmDFX8NHts9dA2Zepao7KSgMAl3DZGyFufVZP78,11085
22
- tinybird/tb/modules/cicd.py,sha256=cCq2NaW_YYlODoJLQGJE1cPNrHGgOqRP6Jkq554h3f8,5679
22
+ tinybird/tb/modules/cicd.py,sha256=F0hQw-TExU9W3NpUSY-msNZ4tlaPeTXjRDpFZ2B2STU,7023
23
23
  tinybird/tb/modules/cli.py,sha256=XtdwMI5uPoKfhlpSuCuhzODRJfTCx1oXHz_bn3x1OBg,16047
24
24
  tinybird/tb/modules/common.py,sha256=6AmvMe8Uj-5A46aUlM3wJg7AilkJEAmHt1hTOb5IH2w,82957
25
25
  tinybird/tb/modules/config.py,sha256=FqdLpLaKpYubqw3xkB4EX06ufZYDgGRxONR_9i-y-KE,11416
@@ -27,7 +27,7 @@ tinybird/tb/modules/connection.py,sha256=WKeDxbTpSsQ1PUmsT730g3S5RT2PtR5mPpVEanD
27
27
  tinybird/tb/modules/copy.py,sha256=MAVqKip8_QhOYq99U_XuqSO6hCLJEh5sFtbhcXtI3SI,5802
28
28
  tinybird/tb/modules/create.py,sha256=FuJYuFqWy2kgSfxSwkQ5nExZgEYALyq_z9dc1d-FRN0,14078
29
29
  tinybird/tb/modules/datasource.py,sha256=dNCK9iCR2xPLfwqqwg2ixyE6NuoVEiJU2mBZBmOYrVY,16906
30
- tinybird/tb/modules/deployment.py,sha256=AuK63a7VXJ0K3YNGj2sFg6ZW1n5Ck-4i2zlZyMPariM,19466
30
+ tinybird/tb/modules/deployment.py,sha256=UIW3W0qKBRk2o4gE8WDjmq9-UkrNZjtkbyKvcQR203k,19515
31
31
  tinybird/tb/modules/endpoint.py,sha256=EhVoGAXsFz-83Fiwj1gI-I73iRRvL49d0W81un7hvPE,12080
32
32
  tinybird/tb/modules/exceptions.py,sha256=4A2sSjCEqKUMqpP3WI00zouCWW4uLaghXXLZBSw04mY,3363
33
33
  tinybird/tb/modules/feedback_manager.py,sha256=7nNiOx7OMebiheLED1r0d75SbuXCNxyBmF4e20rCBNc,69511
@@ -36,7 +36,7 @@ tinybird/tb/modules/infra.py,sha256=GA5xnYLlVItPfJu_3_5NIdHQDuyfk2Z71wtcn9NncGA,
36
36
  tinybird/tb/modules/job.py,sha256=956Pj8BEEsiD2GZsV9RKKVM3I_CveOLgS82lykO5ukk,2963
37
37
  tinybird/tb/modules/llm.py,sha256=AC0VSphTOM2t-v1_3NLvNN_FIbgMo4dTyMqIv5nniPo,835
38
38
  tinybird/tb/modules/llm_utils.py,sha256=nS9r4FAElJw8yXtmdYrx-rtI2zXR8qXfi1QqUDCfxvg,3469
39
- tinybird/tb/modules/local.py,sha256=SS13uDtH6xhhE9fseQH5cGtHWw9nsrMF1gD5wkGEVcw,6936
39
+ tinybird/tb/modules/local.py,sha256=ju4pckNbtCUD9eQpvxEKP_YsVIny8WPidoCxqXEyh3Y,7111
40
40
  tinybird/tb/modules/local_common.py,sha256=RN5OEncHdq7ua4AZ--WgKtaFuEsLvIhq_ROHJadRXXA,3188
41
41
  tinybird/tb/modules/login.py,sha256=dAaBBn_ZIQRm9BFl6Uw_HgZa2qoLuAO6mBOxob_17ms,6253
42
42
  tinybird/tb/modules/logout.py,sha256=ULooy1cDBD02-r7voZmhV7udA0ML5tVuflJyShrh56Y,1022
@@ -81,8 +81,8 @@ tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4
81
81
  tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
82
82
  tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
83
83
  tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
84
- tinybird-0.0.1.dev105.dist-info/METADATA,sha256=mxeUNXYWE-C-m8ciGUCqE98J8sDAt-fD_PrOykb2Gq4,1612
85
- tinybird-0.0.1.dev105.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
86
- tinybird-0.0.1.dev105.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
87
- tinybird-0.0.1.dev105.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
88
- tinybird-0.0.1.dev105.dist-info/RECORD,,
84
+ tinybird-0.0.1.dev107.dist-info/METADATA,sha256=O5fKB-GC4H563pOpRl3NOiRPDOjoCcE661OrM-gzza4,1612
85
+ tinybird-0.0.1.dev107.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
86
+ tinybird-0.0.1.dev107.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
87
+ tinybird-0.0.1.dev107.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
88
+ tinybird-0.0.1.dev107.dist-info/RECORD,,