tinybird 0.0.1.dev229__py3-none-any.whl → 0.0.1.dev231__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.dev229'
8
- __revision__ = '814718e'
7
+ __version__ = '0.0.1.dev231'
8
+ __revision__ = '6e2d225'
@@ -152,7 +152,18 @@ async def cli(
152
152
 
153
153
  config = await get_config(host, token, user_token=user_token, config_file=config_temp._path)
154
154
  client = _get_tb_client(config.get("token", None), config["host"])
155
- folder = os.path.join(config_temp._path.replace(".tinyb", ""), config.get("cwd", os.getcwd()))
155
+
156
+ # Calculate project folder path properly
157
+ tinyb_dir = os.path.dirname(config_temp._path) # Directory containing .tinyb file
158
+ cwd_config = config.get("cwd", ".")
159
+
160
+ if os.path.isabs(cwd_config):
161
+ # If cwd is absolute, use it directly
162
+ folder = cwd_config
163
+ else:
164
+ # If cwd is relative, resolve it relative to .tinyb directory
165
+ folder = os.path.normpath(os.path.join(tinyb_dir, cwd_config))
166
+
156
167
  project = Project(folder=folder, workspace_name=config.get("name", ""), max_depth=max_depth)
157
168
  config["path"] = str(project.path)
158
169
  # If they have passed a token or host as parameter and it's different that record in .tinyb, refresh the workspace id
@@ -788,7 +788,6 @@ async def datasource_create(
788
788
  connection_required = datasource_type in ("kafka", "s3", "gcs")
789
789
 
790
790
  if connection_required:
791
- click.echo(FeedbackManager.gray(message="\n» Creating .connection file..."))
792
791
 
793
792
  def get_connection_files():
794
793
  connection_files = []
@@ -801,6 +800,8 @@ async def datasource_create(
801
800
  return connection_files
802
801
 
803
802
  connection_files = get_connection_files()
803
+
804
+ click.echo(FeedbackManager.gray(message="\n» Selecting connection..."))
804
805
  connection_name = ""
805
806
  topics: List[str] = []
806
807
  if len(connection_files) == 0:
@@ -857,9 +858,29 @@ async def datasource_create(
857
858
  return
858
859
 
859
860
  if not connection_file:
860
- connection_file = connection_files[0]
861
- connection_path = Path(connection_file)
862
- connection = connection_path.stem
861
+ if len(connection_files) > 1:
862
+ click.echo(
863
+ FeedbackManager.highlight(
864
+ message=f"? Multiple {datasource_types[datasource_type][0]} connections found. Please select one:"
865
+ )
866
+ )
867
+ connection_index = -1
868
+ while connection_index == -1:
869
+ for index, conn_file in enumerate(connection_files):
870
+ conn_path = Path(conn_file)
871
+ click.echo(f" [{index + 1}] {conn_path.stem}")
872
+ connection_index = click.prompt("\nSelect option", default=1)
873
+ try:
874
+ connection_file = connection_files[int(connection_index) - 1]
875
+ connection_path = Path(connection_file)
876
+ connection = connection_path.stem
877
+ except Exception:
878
+ connection_index = -1
879
+ else:
880
+ connection_file = connection_files[0]
881
+ connection_path = Path(connection_file)
882
+ connection = connection_path.stem
883
+ click.echo(FeedbackManager.info(message=f"Using connection: {connection}"))
863
884
 
864
885
  click.echo(FeedbackManager.gray(message="\n» Creating .datasource file..."))
865
886
 
@@ -140,11 +140,16 @@ async def get_project_info(project_path: Optional[str] = None) -> Tuple[Iterable
140
140
  config = CLIConfig.get_project_config()
141
141
  tinyb_path = config.get_tinyb_file()
142
142
  current_path = os.getcwd()
143
- project_path = current_path
144
- if tinyb_path:
145
- tinyb_dir = os.path.dirname(tinyb_path)
146
- project_path = os.path.join(tinyb_dir, project_path)
143
+
144
+ if project_path:
145
+ # Use the provided project path
146
+ pass
147
+ elif tinyb_path:
148
+ # Use the directory containing the .tinyb file as the project path
149
+ project_path = os.path.dirname(tinyb_path)
147
150
  else:
151
+ # No .tinyb file found, use current directory
152
+ project_path = current_path
148
153
  tinyb_path = "Not found"
149
154
 
150
155
  columns = ["current", ".tinyb", "project"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev229
3
+ Version: 0.0.1.dev231
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -17,27 +17,27 @@ 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=abf6p2ld9Q1KITecyuYWTXBq4NqGO5evhTrj1jhr90M,247
20
+ tinybird/tb/__cli__.py,sha256=-NVM0s20VK2TP5o3L8acnnH-g8sllfCyX3hX1OXd72I,247
21
21
  tinybird/tb/check_pypi.py,sha256=i3l2L8IajeB7sreikR7oPlYJki9MtS3c_M4crnmbByc,760
22
22
  tinybird/tb/cli.py,sha256=0xYk2Ip4vb3nNFbxfTdG3VoIgdRvUKVbUVU_mviErPA,1107
23
23
  tinybird/tb/client.py,sha256=FKj61vY9STPW03kfVcxYuY1_csI-kP-mc1ERQfqJtg8,56505
24
24
  tinybird/tb/config.py,sha256=jT9xndpeCY_g0HdB5qE2EquC0TFRRnkPnQFWZWd04jo,3998
25
25
  tinybird/tb/modules/build.py,sha256=T36msoBK5g9AZlrJnFRPvlZbrdE265LY1q3Y4YqvS3w,20067
26
26
  tinybird/tb/modules/cicd.py,sha256=H22MaMsqAeDv-OmeHFOlUOAmfNzEzTFaEV9TQ0g4ehs,7338
27
- tinybird/tb/modules/cli.py,sha256=zTUob6oSZszCx-lk6MJbQ_VuNOXBo8b0DOHPWezzMOg,15997
27
+ tinybird/tb/modules/cli.py,sha256=I1G7q3-hjYZuwq1GQoZd5_2i8btl33s6ms8I0yF5XDc,16332
28
28
  tinybird/tb/modules/common.py,sha256=F6oaoFZ3aBxEMjiDKYhthsEIUqSFPkcdlMJ7h7A49Ac,83114
29
29
  tinybird/tb/modules/config.py,sha256=VnzYVUo4q1RBEEMMce4_OCrKp4erhgkRPHElydVlKj0,11488
30
30
  tinybird/tb/modules/connection.py,sha256=KHZgu7sK1C4UBgwkKAMeNdKB0RrTls0LG3YoaUfeAfw,17648
31
31
  tinybird/tb/modules/copy.py,sha256=zHN1d5NA-MFsgbk2kKJq2P9qA8dNOnIsIa60QpVnSwc,4458
32
32
  tinybird/tb/modules/create.py,sha256=56_x6nwj_oAr72X7AvdxXAuXCDKGJp-w1dP6E2XdxqU,23376
33
- tinybird/tb/modules/datasource.py,sha256=UiQXDkSEmQIPj4NcUD_I4bAJe9IGVmlVW07yGgSu6kY,40941
33
+ tinybird/tb/modules/datasource.py,sha256=NRSiaSY58o9hYdlmcyv5TreFkWeqCaNQmR-Q8W3T-yc,42019
34
34
  tinybird/tb/modules/deployment.py,sha256=ByXIgEvwxB49pJEKKj0EJIfORWyflCYr04k8961nBkA,28391
35
35
  tinybird/tb/modules/deprecations.py,sha256=rrszC1f_JJeJ8mUxGoCxckQTJFBCR8wREf4XXXN-PRc,4507
36
36
  tinybird/tb/modules/dev_server.py,sha256=57FCKuWpErwYUYgHspYDkLWEm9F4pbvVOtMrFXX1fVU,10129
37
37
  tinybird/tb/modules/endpoint.py,sha256=rC1CZiEZDMb5chByf4xZhv5PsfkoLeIVDScHQ-QcBsE,12072
38
38
  tinybird/tb/modules/exceptions.py,sha256=5jK91w1LPmtqIUfDpHe_Op5OxGz8-p1BPgtLREMIni0,5217
39
39
  tinybird/tb/modules/feedback_manager.py,sha256=5N2S_ymq0nJPQcFetzoQOWfR6hhx8_gaTp318pe76zU,77966
40
- tinybird/tb/modules/info.py,sha256=NqSsoyzFqbtUEGH_tSowNOI_jSsNuixibln6-plsfOY,6810
40
+ tinybird/tb/modules/info.py,sha256=lAhZZhrp4bIBXIZ8R27jfPWfv4DA4aePgqpXzHU8d1c,6962
41
41
  tinybird/tb/modules/infra.py,sha256=fve30Gj3mG9zbquGxS2e4ipcOYOxviWQCpNFfEzJN_Q,33195
42
42
  tinybird/tb/modules/job.py,sha256=AsUCRNzy7HG5oJ4fyk9NpIm5NtNJgBZSy8MtJdXBe5A,3167
43
43
  tinybird/tb/modules/llm.py,sha256=QbHRcMLgFmLKEh4zVb2ctR_5tIGUGdFJrAiRCDtMxDw,1572
@@ -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.dev229.dist-info/METADATA,sha256=L3f2CdrGIrB29xoxfCof0f5s38emd119j3lnUUCZ3P8,1682
86
- tinybird-0.0.1.dev229.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
87
- tinybird-0.0.1.dev229.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
88
- tinybird-0.0.1.dev229.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
89
- tinybird-0.0.1.dev229.dist-info/RECORD,,
85
+ tinybird-0.0.1.dev231.dist-info/METADATA,sha256=xx59udHdXGwQ0rV0Unph8wKkqYDokrHe_pTdi4JiNFw,1682
86
+ tinybird-0.0.1.dev231.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
87
+ tinybird-0.0.1.dev231.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
88
+ tinybird-0.0.1.dev231.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
89
+ tinybird-0.0.1.dev231.dist-info/RECORD,,