tinybird-cli 3.0.0.dev10__tar.gz → 3.0.0.dev12__tar.gz

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.
Files changed (47) hide show
  1. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/PKG-INFO +11 -4
  2. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/__cli__.py +2 -2
  3. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tb_cli_modules/cli.py +113 -102
  4. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird_cli.egg-info/PKG-INFO +11 -4
  5. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/setup.cfg +0 -0
  6. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/ch_utils/constants.py +0 -0
  7. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/ch_utils/engine.py +0 -0
  8. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/check_pypi.py +0 -0
  9. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/client.py +0 -0
  10. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/config.py +0 -0
  11. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/connector_settings.py +0 -0
  12. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/connectors.py +0 -0
  13. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/context.py +0 -0
  14. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/datafile.py +0 -0
  15. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/datatypes.py +0 -0
  16. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/feedback_manager.py +0 -0
  17. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/git_settings.py +0 -0
  18. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/sql.py +0 -0
  19. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/sql_template.py +0 -0
  20. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/sql_template_fmt.py +0 -0
  21. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/sql_toolset.py +0 -0
  22. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/syncasync.py +0 -0
  23. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tb_cli.py +0 -0
  24. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tb_cli_modules/auth.py +0 -0
  25. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tb_cli_modules/branch.py +0 -0
  26. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tb_cli_modules/cicd.py +0 -0
  27. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tb_cli_modules/common.py +0 -0
  28. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tb_cli_modules/config.py +0 -0
  29. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tb_cli_modules/connection.py +0 -0
  30. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tb_cli_modules/datasource.py +0 -0
  31. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tb_cli_modules/exceptions.py +0 -0
  32. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tb_cli_modules/job.py +0 -0
  33. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tb_cli_modules/pipe.py +0 -0
  34. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tb_cli_modules/regions.py +0 -0
  35. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tb_cli_modules/telemetry.py +0 -0
  36. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tb_cli_modules/test.py +0 -0
  37. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  38. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  39. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tb_cli_modules/token.py +0 -0
  40. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tb_cli_modules/workspace.py +0 -0
  41. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  42. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird/tornado_template.py +0 -0
  43. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird_cli.egg-info/SOURCES.txt +0 -0
  44. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird_cli.egg-info/dependency_links.txt +0 -0
  45. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird_cli.egg-info/entry_points.txt +0 -0
  46. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird_cli.egg-info/requires.txt +0 -0
  47. {tinybird-cli-3.0.0.dev10 → tinybird-cli-3.0.0.dev12}/tinybird_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tinybird-cli
3
- Version: 3.0.0.dev10
3
+ Version: 3.0.0.dev12
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://docs.tinybird.co/cli.html
6
6
  Author: Tinybird
@@ -19,6 +19,16 @@ Changelog
19
19
 
20
20
  ---------
21
21
 
22
+ 3.0.0.dev12
23
+ ************
24
+
25
+ - `Fixed` `tb deploy` now fails with exit 1 in case a release limit has been reached.
26
+
27
+ 3.0.0.dev11
28
+ ************
29
+
30
+ - `Fixed` `tb deploy` validates post --semver
31
+
22
32
  3.0.0.dev10
23
33
  ************
24
34
 
@@ -29,19 +39,16 @@ Changelog
29
39
 
30
40
  - `Changed` Pointing to versions.tinybird.co for docs pages related to Versions
31
41
 
32
-
33
42
  3.0.0.dev8
34
43
  ************
35
44
 
36
45
  - `Changed` Initial git files to include mandatory directories
37
46
 
38
-
39
47
  3.0.0.dev7
40
48
  ************
41
49
 
42
50
  - `Added` `tb release rm --oldest-rollback --force --yes` deletes the oldest rollback Release by creation date
43
51
 
44
-
45
52
  3.0.0.dev6
46
53
  ************
47
54
 
@@ -4,5 +4,5 @@ __description__ = 'Tinybird Command Line Tool'
4
4
  __url__ = 'https://docs.tinybird.co/cli.html'
5
5
  __author__ = 'Tinybird'
6
6
  __author_email__ = 'support@tinybird.co'
7
- __version__ = '3.0.0.dev10'
8
- __revision__ = 'c176e6c'
7
+ __version__ = '3.0.0.dev12'
8
+ __revision__ = 'f798337'
@@ -21,7 +21,13 @@ from click import Context
21
21
  from packaging import version
22
22
 
23
23
  import tinybird.context as context
24
- from tinybird.client import AuthException, AuthNoTokenException, DoesNotExistException, TinyB
24
+ from tinybird.client import (
25
+ AuthException,
26
+ AuthNoTokenException,
27
+ DoesNotExistException,
28
+ OperationCanNotBePerformed,
29
+ TinyB,
30
+ )
25
31
  from tinybird.config import CURRENT_VERSION, SUPPORTED_CONNECTORS, VERSION, FeatureFlags, get_config
26
32
  from tinybird.datafile import (
27
33
  AlreadyExistsException,
@@ -1420,116 +1426,121 @@ async def deploy(
1420
1426
  fork: bool,
1421
1427
  ) -> None:
1422
1428
  """Deploy in tinybird pushing resources changed from previous release using git"""
1429
+ try:
1430
+ ignore_sql_errors = FeatureFlags.ignore_sql_errors()
1431
+ context.disable_template_security_validation.set(True)
1423
1432
 
1424
- ignore_sql_errors = FeatureFlags.ignore_sql_errors()
1425
- context.disable_template_security_validation.set(True)
1433
+ is_internal = has_internal_datafiles(folder)
1426
1434
 
1427
- is_internal = has_internal_datafiles(folder)
1435
+ client: TinyB = ctx.ensure_object(dict)["client"]
1436
+ config = ctx.ensure_object(dict)["config"]
1437
+ workspaces: List[Dict[str, Any]] = (await client.user_workspaces_and_branches()).get("workspaces", [])
1438
+ current_ws: Dict[str, Any] = next(
1439
+ (workspace for workspace in workspaces if config and workspace.get("id", ".") == config.get("id", "..")), {}
1440
+ )
1428
1441
 
1429
- client: TinyB = ctx.ensure_object(dict)["client"]
1430
- config = ctx.ensure_object(dict)["config"]
1431
- workspaces: List[Dict[str, Any]] = (await client.user_workspaces_and_branches()).get("workspaces", [])
1432
- current_ws: Dict[str, Any] = next(
1433
- (workspace for workspace in workspaces if config and workspace.get("id", ".") == config.get("id", "..")), {}
1434
- )
1442
+ semver = config.get("semver")
1443
+ auto_promote = getenv_bool("TB_AUTO_PROMOTE", True)
1444
+ release = current_ws.get("release", {})
1445
+ current_semver: Optional[str] = None
1446
+ if release and isinstance(release, dict):
1447
+ current_semver = release.get("semver")
1435
1448
 
1436
- semver = config.get("semver")
1437
- auto_promote = getenv_bool("TB_AUTO_PROMOTE", True)
1438
- release = current_ws.get("release", {})
1439
- current_semver: Optional[str] = None
1440
- if release and isinstance(release, dict):
1441
- current_semver = release.get("semver")
1442
-
1443
- if not current_semver:
1444
- click.echo(FeedbackManager.error_init_release(workspace=current_ws.get("name")))
1445
- sys.exit(1)
1446
-
1447
- release_created = False
1448
- new_release = False
1449
- if semver and current_semver:
1450
- new_version = version.parse(semver.split("-snapshot")[0])
1451
- current_version = version.parse(current_semver.split("-snapshot")[0])
1452
- click.echo(FeedbackManager.info_releases_detected(current_semver=current_version, semver=new_version))
1453
- if new_version <= current_version:
1454
- click.echo(FeedbackManager.error_bump_release())
1449
+ if not current_semver:
1450
+ click.echo(FeedbackManager.error_init_release(workspace=current_ws.get("name")))
1455
1451
  sys.exit(1)
1456
1452
 
1457
- if is_post_semver(new_version, current_version):
1458
- click.echo(FeedbackManager.info_local_release(version=new_version))
1459
- yes = True
1460
- auto_promote = False
1461
- new_release = False
1462
- elif is_major_semver(new_version, current_version):
1463
- click.echo(FeedbackManager.info_major_release(version=new_version))
1464
- auto_promote = False
1465
- new_release = True
1466
- else:
1467
- # allows TB_AUTO_PROMOTE=0 so release is left in preview
1468
- auto_promote = getenv_bool("TB_AUTO_PROMOTE", True)
1469
- if auto_promote:
1470
- click.echo(FeedbackManager.info_minor_patch_release_with_autopromote(version=new_version))
1453
+ release_created = False
1454
+ new_release = False
1455
+ if semver and current_semver:
1456
+ new_version = version.parse(semver.split("-snapshot")[0])
1457
+ current_version = version.parse(current_semver.split("-snapshot")[0])
1458
+ click.echo(FeedbackManager.info_releases_detected(current_semver=current_version, semver=new_version))
1459
+ if new_version <= current_version:
1460
+ click.echo(FeedbackManager.error_bump_release())
1461
+ sys.exit(1)
1462
+
1463
+ if is_post_semver(new_version, current_version):
1464
+ click.echo(FeedbackManager.info_local_release(version=new_version))
1465
+ yes = True
1466
+ auto_promote = False
1467
+ new_release = False
1468
+ elif is_major_semver(new_version, current_version):
1469
+ click.echo(FeedbackManager.info_major_release(version=new_version))
1470
+ auto_promote = False
1471
+ new_release = True
1471
1472
  else:
1472
- click.echo(FeedbackManager.info_minor_patch_release_no_autopromote(version=new_version))
1473
- new_release = True
1474
- else:
1475
- click.echo(FeedbackManager.error_bump_release())
1476
- sys.exit(1)
1477
-
1478
- if new_release:
1479
- if not dry_run:
1480
- await create_release(client, config, semver)
1481
- release_created = True
1482
- fork_downstream = True
1483
- try:
1484
- await folder_push(
1485
- tb_client=create_tb_client(ctx),
1486
- dry_run=dry_run,
1487
- check=False,
1488
- push_deps=True,
1489
- debug=debug,
1490
- force=True,
1491
- git_release=True,
1492
- override_datasource=override_datasource,
1493
- populate=populate,
1494
- populate_subset=subset,
1495
- populate_condition=sql_condition,
1496
- unlink_on_populate_error=unlink_on_populate_error,
1497
- upload_fixtures=False,
1498
- wait=wait,
1499
- ignore_sql_errors=ignore_sql_errors,
1500
- skip_confirmation=yes,
1501
- workspace_map=dict(workspace_map),
1502
- workspace_lib_paths=workspace,
1503
- timeout=timeout,
1504
- run_tests=False,
1505
- folder=folder,
1506
- config=ctx.ensure_object(dict)["config"],
1507
- user_token=user_token,
1508
- fork_downstream=fork_downstream,
1509
- fork=fork,
1510
- is_internal=is_internal,
1511
- release_created=release_created,
1512
- )
1513
- except Exception as e:
1514
- if release_created and not dry_run:
1515
- await client.release_failed(config["id"], semver)
1516
- raise e
1473
+ # allows TB_AUTO_PROMOTE=0 so release is left in preview
1474
+ auto_promote = getenv_bool("TB_AUTO_PROMOTE", True)
1475
+ if auto_promote:
1476
+ click.echo(FeedbackManager.info_minor_patch_release_with_autopromote(version=new_version))
1477
+ else:
1478
+ click.echo(FeedbackManager.info_minor_patch_release_no_autopromote(version=new_version))
1479
+ new_release = True
1480
+ else:
1481
+ click.echo(FeedbackManager.error_bump_release())
1482
+ sys.exit(1)
1517
1483
 
1518
- if release_created and not dry_run:
1519
- try:
1520
- await client.release_preview(config["id"], semver)
1521
- click.echo(FeedbackManager.success_release_preview(semver=semver))
1522
- if auto_promote:
1484
+ if new_release:
1485
+ if not dry_run:
1523
1486
  try:
1524
- release = await client.release_promote(config["id"], semver)
1525
- click.echo(FeedbackManager.success_release_promote(semver=semver))
1526
- click.echo(FeedbackManager.success_git_release(release_commit=release["commit"]))
1527
- except Exception as e:
1487
+ await create_release(client, config, semver)
1488
+ except OperationCanNotBePerformed as e:
1528
1489
  raise CLIException(FeedbackManager.error_exception(error=str(e)))
1490
+ release_created = True
1491
+ fork_downstream = True
1492
+ try:
1493
+ await folder_push(
1494
+ tb_client=create_tb_client(ctx),
1495
+ dry_run=dry_run,
1496
+ check=False,
1497
+ push_deps=True,
1498
+ debug=debug,
1499
+ force=True,
1500
+ git_release=True,
1501
+ override_datasource=override_datasource,
1502
+ populate=populate,
1503
+ populate_subset=subset,
1504
+ populate_condition=sql_condition,
1505
+ unlink_on_populate_error=unlink_on_populate_error,
1506
+ upload_fixtures=False,
1507
+ wait=wait,
1508
+ ignore_sql_errors=ignore_sql_errors,
1509
+ skip_confirmation=yes,
1510
+ workspace_map=dict(workspace_map),
1511
+ workspace_lib_paths=workspace,
1512
+ timeout=timeout,
1513
+ run_tests=False,
1514
+ folder=folder,
1515
+ config=ctx.ensure_object(dict)["config"],
1516
+ user_token=user_token,
1517
+ fork_downstream=fork_downstream,
1518
+ fork=fork,
1519
+ is_internal=is_internal,
1520
+ release_created=release_created,
1521
+ )
1529
1522
  except Exception as e:
1530
- raise CLIException(FeedbackManager.error_exception(error=str(e)))
1523
+ if release_created and not dry_run:
1524
+ await client.release_failed(config["id"], semver)
1525
+ raise e
1531
1526
 
1532
- if not new_release and not dry_run:
1533
- client.semver = None
1534
- await client.update_release_semver(config["id"], current_semver, semver)
1535
- click.echo(FeedbackManager.success_release_update(semver=current_semver, new_semver=semver))
1527
+ if release_created and not dry_run:
1528
+ try:
1529
+ await client.release_preview(config["id"], semver)
1530
+ click.echo(FeedbackManager.success_release_preview(semver=semver))
1531
+ if auto_promote:
1532
+ try:
1533
+ release = await client.release_promote(config["id"], semver)
1534
+ click.echo(FeedbackManager.success_release_promote(semver=semver))
1535
+ click.echo(FeedbackManager.success_git_release(release_commit=release["commit"]))
1536
+ except Exception as e:
1537
+ raise CLIException(FeedbackManager.error_exception(error=str(e)))
1538
+ except Exception as e:
1539
+ raise CLIException(FeedbackManager.error_exception(error=str(e)))
1540
+
1541
+ if not new_release and not dry_run:
1542
+ client.semver = None
1543
+ await client.update_release_semver(config["id"], current_semver, semver)
1544
+ click.echo(FeedbackManager.success_release_update(semver=current_semver, new_semver=semver))
1545
+ except Exception as e:
1546
+ raise CLIException(str(e))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tinybird-cli
3
- Version: 3.0.0.dev10
3
+ Version: 3.0.0.dev12
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://docs.tinybird.co/cli.html
6
6
  Author: Tinybird
@@ -19,6 +19,16 @@ Changelog
19
19
 
20
20
  ---------
21
21
 
22
+ 3.0.0.dev12
23
+ ************
24
+
25
+ - `Fixed` `tb deploy` now fails with exit 1 in case a release limit has been reached.
26
+
27
+ 3.0.0.dev11
28
+ ************
29
+
30
+ - `Fixed` `tb deploy` validates post --semver
31
+
22
32
  3.0.0.dev10
23
33
  ************
24
34
 
@@ -29,19 +39,16 @@ Changelog
29
39
 
30
40
  - `Changed` Pointing to versions.tinybird.co for docs pages related to Versions
31
41
 
32
-
33
42
  3.0.0.dev8
34
43
  ************
35
44
 
36
45
  - `Changed` Initial git files to include mandatory directories
37
46
 
38
-
39
47
  3.0.0.dev7
40
48
  ************
41
49
 
42
50
  - `Added` `tb release rm --oldest-rollback --force --yes` deletes the oldest rollback Release by creation date
43
51
 
44
-
45
52
  3.0.0.dev6
46
53
  ************
47
54