tinybird 3.5.5.dev0__tar.gz → 4.0.1.dev0__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.
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/PKG-INFO +9 -6
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/__cli__.py +2 -2
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/cli.py +1 -2
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/client.py +3 -33
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/branch.py +90 -1
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/build.py +5 -45
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/build_common.py +8 -24
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/cicd.py +33 -6
- tinybird-4.0.1.dev0/tinybird/tb/modules/cli.py +1111 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/common.py +23 -16
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/config.py +2 -2
- tinybird-4.0.1.dev0/tinybird/tb/modules/create.py +612 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/datasource.py +19 -48
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/deprecations.py +38 -12
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/endpoint.py +6 -4
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/info.py +100 -25
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/local.py +101 -1
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/local_common.py +3 -3
- tinybird-4.0.1.dev0/tinybird/tb/modules/preview.py +128 -0
- tinybird-4.0.1.dev0/tinybird/tb/modules/py_project.py +226 -0
- tinybird-4.0.1.dev0/tinybird/tb/modules/query_output.py +34 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/test.py +0 -20
- tinybird-4.0.1.dev0/tinybird/tb/modules/ts_project.py +235 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/watch.py +2 -8
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/workspace.py +6 -66
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird.egg-info/PKG-INFO +9 -6
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird.egg-info/SOURCES.txt +4 -36
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird.egg-info/requires.txt +0 -5
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/__init__.py +0 -3
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/agent.py +0 -906
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/animations.py +0 -105
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/banner.py +0 -87
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/command_agent.py +0 -75
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/compactor.py +0 -311
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/explore_agent.py +0 -104
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/file_agent.py +0 -64
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/memory.py +0 -113
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/mock_agent.py +0 -213
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/models.py +0 -65
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/prompts.py +0 -1144
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/testing_agent.py +0 -72
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/tools/__init__.py +0 -0
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/tools/analyze.py +0 -91
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/tools/append.py +0 -176
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/tools/build.py +0 -21
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/tools/datafile.py +0 -361
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/tools/deploy.py +0 -50
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/tools/deploy_check.py +0 -29
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/tools/diff_resource.py +0 -49
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/tools/execute_query.py +0 -215
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/tools/file.py +0 -82
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/tools/get_endpoint_stats.py +0 -63
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/tools/get_openapi_definition.py +0 -66
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/tools/mock.py +0 -136
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/tools/plan.py +0 -86
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/tools/request_endpoint.py +0 -93
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/tools/run_command.py +0 -55
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/tools/secret.py +0 -113
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/tools/test.py +0 -256
- tinybird-3.5.5.dev0/tinybird/tb/modules/agent/utils.py +0 -861
- tinybird-3.5.5.dev0/tinybird/tb/modules/cli.py +0 -658
- tinybird-3.5.5.dev0/tinybird/tb/modules/create.py +0 -562
- tinybird-3.5.5.dev0/tinybird/tb/modules/dev_server.py +0 -278
- tinybird-3.5.5.dev0/tinybird/tb/modules/mock.py +0 -41
- tinybird-3.5.5.dev0/tinybird/tb/modules/mock_common.py +0 -17
- tinybird-3.5.5.dev0/tinybird/tb/modules/shell.py +0 -380
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/setup.cfg +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/__cli__.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/ch_utils/engine.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/check_pypi.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/client.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/config.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/context.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/datafile/common.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/datafile/exceptions.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/datafile/parse_connection.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/datafile/parse_datasource.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/datafile/parse_pipe.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/datatypes.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/feedback_manager.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/git_settings.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/prompts.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/service_datasources.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/sql.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/sql_template.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/sql_template_fmt.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/sql_toolset.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/syncasync.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/check_pypi.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/config.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/connection.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/connection_kafka.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/connection_s3.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/copy.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/datafile/build.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/datafile/build_common.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/datafile/diff.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/datafile/fixture.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/datafile/format_common.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/datafile/format_connection.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/datafile/playground.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/datafile/pull.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/deployment.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/deployment_common.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/exceptions.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/feedback_manager.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/fmt.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/infra.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/job.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/job_common.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/llm.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/llm_utils.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/local_logs.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/login.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/login_common.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/logout.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/materialization.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/open.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/pipe.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/project.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/project_commands.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/regions.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/secret.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/secret_common.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/sink.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/table.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/telemetry.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/test_common.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/token.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb/modules/workspace_members.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli_modules/branch.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli_modules/common.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli_modules/connection.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli_modules/datasource.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli_modules/fmt.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli_modules/tag.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird/tornado_template.py +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird.egg-info/dependency_links.txt +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird.egg-info/entry_points.txt +0 -0
- {tinybird-3.5.5.dev0 → tinybird-4.0.1.dev0}/tinybird.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: tinybird
|
|
3
|
-
Version:
|
|
3
|
+
Version: 4.0.1.dev0
|
|
4
4
|
Summary: Tinybird Command Line Tool
|
|
5
5
|
Home-page: https://www.tinybird.co/docs/forward/commands
|
|
6
6
|
Author: Tinybird
|
|
@@ -8,7 +8,6 @@ Author-email: support@tinybird.co
|
|
|
8
8
|
Requires-Python: >=3.10, <3.14
|
|
9
9
|
Description-Content-Type: text/x-rst
|
|
10
10
|
Requires-Dist: aiofiles==24.1.0
|
|
11
|
-
Requires-Dist: anthropic==0.55.0
|
|
12
11
|
Requires-Dist: boto3
|
|
13
12
|
Requires-Dist: click<8.2,>=8.1.6
|
|
14
13
|
Requires-Dist: clickhouse-toolset==0.34.dev0
|
|
@@ -19,12 +18,9 @@ Requires-Dist: croniter==1.3.15
|
|
|
19
18
|
Requires-Dist: docker==7.1.0
|
|
20
19
|
Requires-Dist: GitPython~=3.1.32
|
|
21
20
|
Requires-Dist: humanfriendly~=8.2
|
|
22
|
-
Requires-Dist: plotext==5.3.2
|
|
23
21
|
Requires-Dist: prompt_toolkit==3.0.48
|
|
24
22
|
Requires-Dist: logfire-api==4.2.0
|
|
25
23
|
Requires-Dist: pydantic~=2.11.7
|
|
26
|
-
Requires-Dist: pydantic-ai-slim[anthropic]~=0.5.0
|
|
27
|
-
Requires-Dist: pydantic-ai-slim[retries]~=0.5.0
|
|
28
24
|
Requires-Dist: pyperclip==1.9.0
|
|
29
25
|
Requires-Dist: pyyaml<6.1,>=6.0
|
|
30
26
|
Requires-Dist: requests<3,>=2.28.1
|
|
@@ -36,7 +32,6 @@ Requires-Dist: urllib3<2,>=1.26.14
|
|
|
36
32
|
Requires-Dist: watchdog==6.0.0
|
|
37
33
|
Requires-Dist: wheel
|
|
38
34
|
Requires-Dist: packaging<24,>=23.1
|
|
39
|
-
Requires-Dist: llm>=0.19
|
|
40
35
|
Requires-Dist: thefuzz==0.22.1
|
|
41
36
|
Requires-Dist: python-dotenv==1.1.0
|
|
42
37
|
Requires-Dist: pyjwt[crypto]==2.9.0
|
|
@@ -57,6 +52,14 @@ The Tinybird command-line tool allows you to use all the Tinybird functionality
|
|
|
57
52
|
Changelog
|
|
58
53
|
----------
|
|
59
54
|
|
|
55
|
+
4.0.0
|
|
56
|
+
*******
|
|
57
|
+
|
|
58
|
+
- `Removed` Tinybird Code entry points and AI-assisted command paths (`tb --prompt`, `tb datasource create --prompt`, `tb test create`, and `tb mock`).
|
|
59
|
+
- `Changed` `tb init` is now the project scaffolding command.
|
|
60
|
+
- `Changed` `tb build` now uses the `dev_mode` configuration from the project JSON config file.
|
|
61
|
+
- `Changed` `tb deploy` now uses the `dev_mode` configuration from the project JSON config file.
|
|
62
|
+
|
|
60
63
|
3.5.4
|
|
61
64
|
*******
|
|
62
65
|
|
|
@@ -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__ = '
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '4.0.1.dev0'
|
|
8
|
+
__revision__ = 'aaa17c7'
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import tinybird.tb.modules.agent
|
|
2
1
|
import tinybird.tb.modules.branch
|
|
3
2
|
import tinybird.tb.modules.build
|
|
4
3
|
import tinybird.tb.modules.cli
|
|
@@ -18,9 +17,9 @@ import tinybird.tb.modules.local
|
|
|
18
17
|
import tinybird.tb.modules.login
|
|
19
18
|
import tinybird.tb.modules.logout
|
|
20
19
|
import tinybird.tb.modules.materialization
|
|
21
|
-
import tinybird.tb.modules.mock
|
|
22
20
|
import tinybird.tb.modules.open
|
|
23
21
|
import tinybird.tb.modules.pipe
|
|
22
|
+
import tinybird.tb.modules.preview
|
|
24
23
|
import tinybird.tb.modules.project_commands
|
|
25
24
|
import tinybird.tb.modules.secret
|
|
26
25
|
import tinybird.tb.modules.sink
|
|
@@ -12,7 +12,6 @@ import requests.adapters
|
|
|
12
12
|
from requests import Response
|
|
13
13
|
from urllib3 import Retry
|
|
14
14
|
|
|
15
|
-
from tinybird.ch_utils.constants import COPY_ENABLED_TABLE_FUNCTIONS
|
|
16
15
|
from tinybird.tb.modules.telemetry import add_telemetry_event
|
|
17
16
|
|
|
18
17
|
HOST = "https://api.tinybird.co"
|
|
@@ -1174,30 +1173,13 @@ class TinyB:
|
|
|
1174
1173
|
return self._req(f"/v0/integrations/{service}/policies/read-access-policy?{urlencode(params)}")
|
|
1175
1174
|
|
|
1176
1175
|
def sql_get_format(self, sql: str, with_clickhouse_format: bool = False) -> str:
|
|
1177
|
-
|
|
1178
|
-
if with_clickhouse_format:
|
|
1179
|
-
from tinybird.sql_toolset import format_sql
|
|
1180
|
-
|
|
1181
|
-
return format_sql(sql)
|
|
1182
|
-
else:
|
|
1183
|
-
return self._sql_get_format_remote(sql, with_clickhouse_format)
|
|
1184
|
-
except ModuleNotFoundError:
|
|
1185
|
-
return self._sql_get_format_remote(sql, with_clickhouse_format)
|
|
1176
|
+
return self._sql_get_format_remote(sql, with_clickhouse_format)
|
|
1186
1177
|
|
|
1187
1178
|
def _sql_get_format_remote(self, sql: str, with_clickhouse_format: bool = False) -> str:
|
|
1188
1179
|
params = {"with_clickhouse_format": "true" if with_clickhouse_format else "false"}
|
|
1189
1180
|
result = self._req(f"/v0/sql_format?q={quote(sql, safe='')}&{urlencode(params)}")
|
|
1190
1181
|
return result["q"]
|
|
1191
1182
|
|
|
1192
|
-
@staticmethod
|
|
1193
|
-
def _sql_get_used_tables_local(sql: str, raising: bool = False, is_copy: Optional[bool] = False) -> List[str]:
|
|
1194
|
-
from tinybird.sql_toolset import sql_get_used_tables
|
|
1195
|
-
|
|
1196
|
-
tables = sql_get_used_tables(
|
|
1197
|
-
sql, raising, table_functions=False, function_allow_list=COPY_ENABLED_TABLE_FUNCTIONS if is_copy else None
|
|
1198
|
-
)
|
|
1199
|
-
return [t[1] if t[0] == "" else f"{t[0]}.{t[1]}" for t in tables]
|
|
1200
|
-
|
|
1201
1183
|
def _sql_get_used_tables_remote(
|
|
1202
1184
|
self, sql: str, raising: bool = False, is_copy: Optional[bool] = False
|
|
1203
1185
|
) -> List[str]:
|
|
@@ -1212,16 +1194,7 @@ class TinyB:
|
|
|
1212
1194
|
|
|
1213
1195
|
# Get used tables from a query. Does not include table functions
|
|
1214
1196
|
def sql_get_used_tables(self, sql: str, raising: bool = False, is_copy: Optional[bool] = False) -> List[str]:
|
|
1215
|
-
|
|
1216
|
-
return self._sql_get_used_tables_local(sql, raising, is_copy)
|
|
1217
|
-
except ModuleNotFoundError:
|
|
1218
|
-
return self._sql_get_used_tables_remote(sql, raising, is_copy)
|
|
1219
|
-
|
|
1220
|
-
@staticmethod
|
|
1221
|
-
def _replace_tables_local(q: str, replacements):
|
|
1222
|
-
from tinybird.sql_toolset import replace_tables, replacements_to_tuples
|
|
1223
|
-
|
|
1224
|
-
return replace_tables(q, replacements_to_tuples(replacements))
|
|
1197
|
+
return self._sql_get_used_tables_remote(sql, raising, is_copy)
|
|
1225
1198
|
|
|
1226
1199
|
def _replace_tables_remote(self, q: str, replacements):
|
|
1227
1200
|
params = {
|
|
@@ -1232,10 +1205,7 @@ class TinyB:
|
|
|
1232
1205
|
return result["query"]
|
|
1233
1206
|
|
|
1234
1207
|
def replace_tables(self, q: str, replacements):
|
|
1235
|
-
|
|
1236
|
-
return self._replace_tables_local(q, replacements)
|
|
1237
|
-
except ModuleNotFoundError:
|
|
1238
|
-
return self._replace_tables_remote(q, replacements)
|
|
1208
|
+
return self._replace_tables_remote(q, replacements)
|
|
1239
1209
|
|
|
1240
1210
|
def get_connection(self, **kwargs):
|
|
1241
1211
|
result = self._req("/v0/connectors")
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# - If it makes sense and only when strictly necessary, you can create utility functions in this file.
|
|
4
4
|
# - But please, **do not** interleave utility functions and command definitions.
|
|
5
5
|
|
|
6
|
-
from typing import List, Optional, Tuple
|
|
6
|
+
from typing import Any, Dict, List, Optional, Tuple
|
|
7
7
|
|
|
8
8
|
import click
|
|
9
9
|
|
|
@@ -17,6 +17,7 @@ from tinybird.tb.modules.common import (
|
|
|
17
17
|
get_workspace_member_email,
|
|
18
18
|
switch_to_workspace_by_user_workspace_data,
|
|
19
19
|
try_update_config_with_remote,
|
|
20
|
+
wait_job,
|
|
20
21
|
)
|
|
21
22
|
from tinybird.tb.modules.config import CLIConfig
|
|
22
23
|
from tinybird.tb.modules.exceptions import CLIBranchException, CLIException
|
|
@@ -148,3 +149,91 @@ def delete_branch(branch_name_or_id: str, yes: bool) -> None:
|
|
|
148
149
|
switch_to_workspace_by_user_workspace_data(config, workspace_main)
|
|
149
150
|
else:
|
|
150
151
|
raise CLIException(FeedbackManager.error_switching_to_main())
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
@branch.command(name="clear", short_help="Clear a branch by deleting and recreating it.")
|
|
155
|
+
@click.argument("branch_name_or_id", required=False)
|
|
156
|
+
@click.option(
|
|
157
|
+
"--last-partition",
|
|
158
|
+
is_flag=True,
|
|
159
|
+
default=False,
|
|
160
|
+
help="Attach the last modified partition from the current workspace to the new branch",
|
|
161
|
+
)
|
|
162
|
+
@click.option(
|
|
163
|
+
"-i",
|
|
164
|
+
"--ignore-datasource",
|
|
165
|
+
"ignore_datasources",
|
|
166
|
+
type=str,
|
|
167
|
+
multiple=True,
|
|
168
|
+
help="Ignore specified data source partitions",
|
|
169
|
+
)
|
|
170
|
+
@click.option(
|
|
171
|
+
"--wait/--no-wait",
|
|
172
|
+
is_flag=True,
|
|
173
|
+
default=True,
|
|
174
|
+
help="Wait for data branch jobs to finish, showing a progress bar. Disabled by default.",
|
|
175
|
+
)
|
|
176
|
+
@click.option("--yes", is_flag=True, default=False, help="Do not ask for confirmation")
|
|
177
|
+
def clear_branch(
|
|
178
|
+
branch_name_or_id: Optional[str],
|
|
179
|
+
last_partition: bool,
|
|
180
|
+
ignore_datasources: Tuple[str, ...],
|
|
181
|
+
wait: bool,
|
|
182
|
+
yes: bool,
|
|
183
|
+
) -> None:
|
|
184
|
+
"""Clear a branch by deleting and recreating it."""
|
|
185
|
+
config = CLIConfig.get_project_config()
|
|
186
|
+
_ = try_update_config_with_remote(config, only_if_needed=True)
|
|
187
|
+
|
|
188
|
+
current_main_workspace = get_current_main_workspace(config)
|
|
189
|
+
if not current_main_workspace:
|
|
190
|
+
raise CLIException(FeedbackManager.error_unable_to_identify_main_workspace())
|
|
191
|
+
|
|
192
|
+
workspace_branches = get_current_workspace_branches(config)
|
|
193
|
+
workspace_to_clear: Optional[Dict[str, Any]] = None
|
|
194
|
+
|
|
195
|
+
if branch_name_or_id:
|
|
196
|
+
if branch_name_or_id == MAIN_BRANCH:
|
|
197
|
+
raise CLIException(FeedbackManager.error_not_allowed_in_main_branch())
|
|
198
|
+
workspace_to_clear = next(
|
|
199
|
+
(
|
|
200
|
+
workspace
|
|
201
|
+
for workspace in workspace_branches
|
|
202
|
+
if workspace["name"] == branch_name_or_id or workspace["id"] == branch_name_or_id
|
|
203
|
+
),
|
|
204
|
+
None,
|
|
205
|
+
)
|
|
206
|
+
else:
|
|
207
|
+
workspace_to_clear = next(
|
|
208
|
+
(workspace for workspace in workspace_branches if workspace["id"] == config["id"]), None
|
|
209
|
+
)
|
|
210
|
+
if not workspace_to_clear:
|
|
211
|
+
raise CLIBranchException(FeedbackManager.error_not_a_branch())
|
|
212
|
+
|
|
213
|
+
if not workspace_to_clear:
|
|
214
|
+
raise CLIBranchException(FeedbackManager.error_branch(branch=branch_name_or_id or ""))
|
|
215
|
+
|
|
216
|
+
branch_name = workspace_to_clear["name"]
|
|
217
|
+
if yes or click.confirm(FeedbackManager.warning_confirm_clear_workspace()):
|
|
218
|
+
was_current_branch = workspace_to_clear["id"] == config.get("id")
|
|
219
|
+
client = config.get_client(token=current_main_workspace.get("token"))
|
|
220
|
+
try:
|
|
221
|
+
client.delete_branch(workspace_to_clear["id"])
|
|
222
|
+
response = client.create_workspace_branch(branch_name, last_partition, False, list(ignore_datasources))
|
|
223
|
+
if wait and "job" in response:
|
|
224
|
+
job_id = response["job"]["job_id"]
|
|
225
|
+
job_url = response["job"]["job_url"]
|
|
226
|
+
wait_job(client, job_id, job_url, "Environment creation")
|
|
227
|
+
except Exception as e:
|
|
228
|
+
raise CLIBranchException(FeedbackManager.error_exception(error=str(e)))
|
|
229
|
+
|
|
230
|
+
recreated_branches = client.user_workspace_branches("v1").get("workspaces", [])
|
|
231
|
+
recreated_branch = next(
|
|
232
|
+
(workspace for workspace in recreated_branches if workspace.get("name") == branch_name), None
|
|
233
|
+
)
|
|
234
|
+
if not recreated_branch:
|
|
235
|
+
raise CLIBranchException(FeedbackManager.error_branch(branch=branch_name))
|
|
236
|
+
|
|
237
|
+
click.echo(FeedbackManager.success(message=f"✓ Branch '{branch_name}' cleared"))
|
|
238
|
+
if was_current_branch:
|
|
239
|
+
switch_to_workspace_by_user_workspace_data(config, recreated_branch)
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import threading
|
|
2
1
|
import time
|
|
3
2
|
from copy import deepcopy
|
|
4
3
|
from functools import partial
|
|
@@ -17,10 +16,9 @@ from tinybird.tb.modules.build_common import process
|
|
|
17
16
|
from tinybird.tb.modules.cli import cli
|
|
18
17
|
from tinybird.tb.modules.config import CLIConfig
|
|
19
18
|
from tinybird.tb.modules.datafile.playground import folder_playground
|
|
20
|
-
from tinybird.tb.modules.dev_server import BuildStatus, start_server
|
|
21
19
|
from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
22
20
|
from tinybird.tb.modules.project import Project
|
|
23
|
-
from tinybird.tb.modules.
|
|
21
|
+
from tinybird.tb.modules.query_output import print_table_formatted
|
|
24
22
|
from tinybird.tb.modules.watch import watch_files, watch_project
|
|
25
23
|
|
|
26
24
|
|
|
@@ -68,7 +66,6 @@ def build(ctx: click.Context, watch: bool, with_connections: bool) -> None:
|
|
|
68
66
|
if watch:
|
|
69
67
|
run_watch(
|
|
70
68
|
project=project,
|
|
71
|
-
tb_client=tb_client,
|
|
72
69
|
config=config,
|
|
73
70
|
process=partial(
|
|
74
71
|
process,
|
|
@@ -83,15 +80,13 @@ def build(ctx: click.Context, watch: bool, with_connections: bool) -> None:
|
|
|
83
80
|
|
|
84
81
|
|
|
85
82
|
@cli.command("dev", help="Build the project server side and watch for changes.")
|
|
86
|
-
@click.option("--data-origin", type=str, default="", help="Data origin: local or cloud")
|
|
87
|
-
@click.option("--ui/--skip-ui", is_flag=True, default=True, help="Connect your local project to Tinybird UI")
|
|
88
83
|
@click.option(
|
|
89
84
|
"--with-connections/--no-connections",
|
|
90
85
|
default=None,
|
|
91
86
|
help="Create data linkers for connection datasources (S3, Kafka, GCS). Defaults to true for branches.",
|
|
92
87
|
)
|
|
93
88
|
@click.pass_context
|
|
94
|
-
def dev(ctx: click.Context,
|
|
89
|
+
def dev(ctx: click.Context, with_connections: Optional[bool]) -> None:
|
|
95
90
|
obj: Dict[str, Any] = ctx.ensure_object(dict)
|
|
96
91
|
branch: Optional[str] = ctx.ensure_object(dict)["branch"]
|
|
97
92
|
is_branch = bool(branch)
|
|
@@ -103,47 +98,26 @@ def dev(ctx: click.Context, data_origin: str, ui: bool, with_connections: Option
|
|
|
103
98
|
if obj["env"] == "cloud" and not is_branch:
|
|
104
99
|
raise click.ClickException(FeedbackManager.error_build_only_supported_in_local())
|
|
105
100
|
|
|
106
|
-
if data_origin == "cloud":
|
|
107
|
-
click.echo(
|
|
108
|
-
FeedbackManager.warning(
|
|
109
|
-
message="--data-origin=cloud is deprecated and will be removed in a future version. Create an branch and use `tb --branch <branch_name> dev`"
|
|
110
|
-
)
|
|
111
|
-
)
|
|
112
|
-
return dev_cloud(ctx)
|
|
113
|
-
|
|
114
101
|
project: Project = ctx.ensure_object(dict)["project"]
|
|
115
102
|
tb_client: TinyB = ctx.ensure_object(dict)["client"]
|
|
116
103
|
config: Dict[str, Any] = ctx.ensure_object(dict)["config"]
|
|
117
104
|
|
|
118
|
-
build_status = BuildStatus()
|
|
119
|
-
if ui:
|
|
120
|
-
server_thread = threading.Thread(
|
|
121
|
-
target=start_server, args=(project, tb_client, process, build_status, branch), daemon=True
|
|
122
|
-
)
|
|
123
|
-
server_thread.start()
|
|
124
|
-
# Wait for the server to start
|
|
125
|
-
time.sleep(0.5)
|
|
126
|
-
|
|
127
105
|
click.echo(FeedbackManager.highlight_building_project())
|
|
128
106
|
process(
|
|
129
107
|
project=project,
|
|
130
108
|
tb_client=tb_client,
|
|
131
109
|
watch=True,
|
|
132
110
|
config=config,
|
|
133
|
-
build_status=build_status,
|
|
134
111
|
is_branch=is_branch,
|
|
135
112
|
with_connections=with_connections,
|
|
136
113
|
)
|
|
137
114
|
run_watch(
|
|
138
115
|
project=project,
|
|
139
|
-
tb_client=tb_client,
|
|
140
116
|
config=config,
|
|
141
|
-
branch=branch,
|
|
142
117
|
process=partial(
|
|
143
118
|
process,
|
|
144
119
|
project=project,
|
|
145
120
|
tb_client=tb_client,
|
|
146
|
-
build_status=build_status,
|
|
147
121
|
config=config,
|
|
148
122
|
is_branch=is_branch,
|
|
149
123
|
with_connections=with_connections,
|
|
@@ -151,18 +125,9 @@ def dev(ctx: click.Context, data_origin: str, ui: bool, with_connections: Option
|
|
|
151
125
|
)
|
|
152
126
|
|
|
153
127
|
|
|
154
|
-
def run_watch(
|
|
155
|
-
project: Project, tb_client: TinyB, process: Callable, config: dict[str, Any], branch: Optional[str] = None
|
|
156
|
-
) -> None:
|
|
157
|
-
shell = Shell(project=project, tb_client=tb_client, branch=branch)
|
|
128
|
+
def run_watch(project: Project, process: Callable, config: dict[str, Any]) -> None:
|
|
158
129
|
click.echo(FeedbackManager.gray(message="\nWatching for changes..."))
|
|
159
|
-
|
|
160
|
-
target=watch_project,
|
|
161
|
-
args=(shell, process, project, config),
|
|
162
|
-
daemon=True,
|
|
163
|
-
)
|
|
164
|
-
watcher_thread.start()
|
|
165
|
-
shell.run()
|
|
130
|
+
watch_project(process=process, project=project, config=config)
|
|
166
131
|
|
|
167
132
|
|
|
168
133
|
def is_vendor(f: Path) -> bool:
|
|
@@ -244,13 +209,8 @@ def dev_cloud(
|
|
|
244
209
|
|
|
245
210
|
build_ok = build_once(filenames)
|
|
246
211
|
|
|
247
|
-
shell = Shell(project=project, tb_client=tb_client, playground=True)
|
|
248
212
|
click.echo(FeedbackManager.gray(message="\nWatching for changes..."))
|
|
249
|
-
|
|
250
|
-
target=watch_files, args=(filenames, process, shell, project, build_ok), daemon=True
|
|
251
|
-
)
|
|
252
|
-
watcher_thread.start()
|
|
253
|
-
shell.run()
|
|
213
|
+
watch_files(filenames=filenames, process=process, project=project, build_ok=build_ok)
|
|
254
214
|
|
|
255
215
|
|
|
256
216
|
def build_and_print_resource(config: CLIConfig, tb_client: TinyB, filename: str):
|
|
@@ -14,11 +14,10 @@ from tinybird.datafile.parse_datasource import parse_datasource
|
|
|
14
14
|
from tinybird.tb.client import TinyB
|
|
15
15
|
from tinybird.tb.modules.common import push_data, sys_exit
|
|
16
16
|
from tinybird.tb.modules.datafile.fixture import FixtureExtension, get_fixture_dir, persist_fixture
|
|
17
|
-
from tinybird.tb.modules.dev_server import BuildStatus
|
|
18
17
|
from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
19
18
|
from tinybird.tb.modules.local_common import get_local_tokens
|
|
20
19
|
from tinybird.tb.modules.project import Project
|
|
21
|
-
from tinybird.tb.modules.
|
|
20
|
+
from tinybird.tb.modules.query_output import print_table_formatted
|
|
22
21
|
|
|
23
22
|
|
|
24
23
|
def process(
|
|
@@ -29,7 +28,6 @@ def process(
|
|
|
29
28
|
file_changed: Optional[str] = None,
|
|
30
29
|
diff: Optional[str] = None,
|
|
31
30
|
silent: bool = False,
|
|
32
|
-
build_status: Optional[BuildStatus] = None,
|
|
33
31
|
exit_on_error: bool = True,
|
|
34
32
|
load_fixtures: bool = True,
|
|
35
33
|
project_with_vendors: Optional[Project] = None,
|
|
@@ -49,25 +47,15 @@ def process(
|
|
|
49
47
|
build_failed = False
|
|
50
48
|
build_error: Optional[str] = None
|
|
51
49
|
build_result: Optional[bool] = None
|
|
52
|
-
|
|
53
|
-
if build_status.building:
|
|
54
|
-
return build_status.error
|
|
55
|
-
else:
|
|
56
|
-
build_status.building = True
|
|
50
|
+
|
|
57
51
|
if file_changed and file_changed.endswith((FixtureExtension.NDJSON, FixtureExtension.CSV)):
|
|
58
52
|
rebuild_fixture(project, tb_client, file_changed)
|
|
59
|
-
|
|
60
|
-
build_status.building = False
|
|
61
|
-
build_status.error = None
|
|
53
|
+
|
|
62
54
|
elif file_changed and file_changed.endswith(".sql"):
|
|
63
55
|
rebuild_fixture_sql(project, tb_client, file_changed)
|
|
64
|
-
|
|
65
|
-
build_status.building = False
|
|
66
|
-
build_status.error = None
|
|
56
|
+
|
|
67
57
|
elif file_changed and file_changed.endswith((".env.local", ".env")):
|
|
68
|
-
|
|
69
|
-
build_status.building = False
|
|
70
|
-
build_status.error = None
|
|
58
|
+
pass
|
|
71
59
|
else:
|
|
72
60
|
try:
|
|
73
61
|
build_result = build_project(
|
|
@@ -78,16 +66,14 @@ def process(
|
|
|
78
66
|
project_with_vendors=project_with_vendors,
|
|
79
67
|
with_connections=with_connections,
|
|
80
68
|
)
|
|
81
|
-
|
|
82
|
-
build_status.building = False
|
|
83
|
-
build_status.error = None
|
|
69
|
+
|
|
84
70
|
except click.ClickException as e:
|
|
85
71
|
if not silent:
|
|
86
72
|
click.echo(FeedbackManager.info(message=str(e)))
|
|
87
73
|
build_error = str(e)
|
|
88
74
|
build_failed = True
|
|
89
75
|
try:
|
|
90
|
-
if file_changed and not build_failed
|
|
76
|
+
if file_changed and not build_failed:
|
|
91
77
|
show_data(tb_client, file_changed, diff)
|
|
92
78
|
except Exception:
|
|
93
79
|
pass
|
|
@@ -102,9 +88,7 @@ def process(
|
|
|
102
88
|
if not watch and exit_on_error:
|
|
103
89
|
sys_exit("build_error", build_error or "Unknown error")
|
|
104
90
|
build_error = build_error or "Unknown error"
|
|
105
|
-
|
|
106
|
-
build_status.error = build_error
|
|
107
|
-
build_status.building = False
|
|
91
|
+
|
|
108
92
|
return build_error
|
|
109
93
|
|
|
110
94
|
if not silent:
|
|
@@ -236,11 +236,25 @@ class GitLabCICDGenerator(CICDGeneratorBase):
|
|
|
236
236
|
def init_cicd(
|
|
237
237
|
path: Optional[str] = None,
|
|
238
238
|
data_project_dir: Optional[str] = None,
|
|
239
|
+
provider: Optional[str] = None,
|
|
239
240
|
):
|
|
240
|
-
|
|
241
|
+
providers: List[Provider]
|
|
242
|
+
if provider is None:
|
|
243
|
+
providers = list(Provider)
|
|
244
|
+
else:
|
|
245
|
+
provider_map = {
|
|
246
|
+
"github": Provider.GitHub,
|
|
247
|
+
"gitlab": Provider.GitLab,
|
|
248
|
+
}
|
|
249
|
+
provider_key = provider.strip().lower()
|
|
250
|
+
if provider_key not in provider_map:
|
|
251
|
+
raise ValueError(f"Unsupported CI/CD provider: {provider}")
|
|
252
|
+
providers = [provider_map[provider_key]]
|
|
253
|
+
|
|
254
|
+
for provider_item in providers:
|
|
241
255
|
path = path or getcwd()
|
|
242
256
|
data_project_dir = data_project_dir or "."
|
|
243
|
-
generator = CICDGeneratorBase.build_generator(
|
|
257
|
+
generator = CICDGeneratorBase.build_generator(provider_item.name)
|
|
244
258
|
params = {
|
|
245
259
|
"data_project_dir": data_project_dir,
|
|
246
260
|
"workflow_version": WORKFLOW_VERSION,
|
|
@@ -250,10 +264,23 @@ def init_cicd(
|
|
|
250
264
|
click.echo(warning_message)
|
|
251
265
|
|
|
252
266
|
|
|
253
|
-
def check_cicd_exists(path: Optional[str] = None) -> Optional[Provider]:
|
|
267
|
+
def check_cicd_exists(path: Optional[str] = None, provider: Optional[str] = None) -> Optional[Provider]:
|
|
254
268
|
path = path or getcwd()
|
|
255
|
-
|
|
256
|
-
|
|
269
|
+
providers: List[Provider]
|
|
270
|
+
if provider is None:
|
|
271
|
+
providers = list(Provider)
|
|
272
|
+
else:
|
|
273
|
+
provider_map = {
|
|
274
|
+
"github": Provider.GitHub,
|
|
275
|
+
"gitlab": Provider.GitLab,
|
|
276
|
+
}
|
|
277
|
+
provider_key = provider.strip().lower()
|
|
278
|
+
if provider_key not in provider_map:
|
|
279
|
+
raise ValueError(f"Unsupported CI/CD provider: {provider}")
|
|
280
|
+
providers = [provider_map[provider_key]]
|
|
281
|
+
|
|
282
|
+
for provider_item in providers:
|
|
283
|
+
generator = CICDGeneratorBase.build_generator(provider_item.name)
|
|
257
284
|
if generator.is_already_generated(path):
|
|
258
|
-
return
|
|
285
|
+
return provider_item
|
|
259
286
|
return None
|