diff --git a/cookiecutter/mapper-template/cookiecutter.json b/cookiecutter/mapper-template/cookiecutter.json index c42b1cf06..9d7b6385f 100644 --- a/cookiecutter/mapper-template/cookiecutter.json +++ b/cookiecutter/mapper-template/cookiecutter.json @@ -7,6 +7,7 @@ "variant": "None (Skip)", "include_ci_files": ["GitHub", "None (Skip)"], "license": ["Apache-2.0"], + "ide": ["VSCode", "None"], "__prompts__": { "name": "The name of the mapper, in CamelCase", "admin_name": "Provide your [bold yellow]full name[/]", @@ -14,6 +15,7 @@ "mapper_id": "The ID of the tap, in kebab-case", "library_name": "The name of the library, in snake_case. This is how the library will be imported in Python.", "include_ci_files": "Whether to include CI files for a common CI services", - "license": "The license for the project" + "license": "The license for the project", + "ide": "Add configuration files for your preferred IDE" } } diff --git a/cookiecutter/mapper-template/hooks/post_gen_project.py b/cookiecutter/mapper-template/hooks/post_gen_project.py new file mode 100644 index 000000000..a700beb50 --- /dev/null +++ b/cookiecutter/mapper-template/hooks/post_gen_project.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +from pathlib import Path +import shutil + + +BASE_PATH = Path("{{cookiecutter.library_name}}") + + +if __name__ == "__main__": + if "{{ cookiecutter.license }}" != "Apache-2.0": + Path("LICENSE").unlink() + + if "{{ cookiecutter.include_ci_files }}" != "GitHub": + shutil.rmtree(Path(".github")) + + if "{{ cookiecutter.ide }}" != "VSCode": + shutil.rmtree(".vscode") diff --git a/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/{% if cookiecutter.include_ci_files == 'GitHub' %}dependabot.yml{%endif%} b/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/dependabot.yml similarity index 100% rename from cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/{% if cookiecutter.include_ci_files == 'GitHub' %}dependabot.yml{%endif%} rename to cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/dependabot.yml diff --git a/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/workflows/{% if cookiecutter.include_ci_files == 'GitHub' %}test.yml{%endif%} b/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/workflows/test.yml similarity index 100% rename from cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/workflows/{% if cookiecutter.include_ci_files == 'GitHub' %}test.yml{%endif%} rename to cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/workflows/test.yml diff --git a/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/{%if 'Apache-2.0' == cookiecutter.license %}LICENSE{%endif%} b/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/LICENSE similarity index 100% rename from cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/{%if 'Apache-2.0' == cookiecutter.license %}LICENSE{%endif%} rename to cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/LICENSE diff --git a/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/{{cookiecutter.library_name}}/__main__.py b/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/{{cookiecutter.library_name}}/__main__.py new file mode 100644 index 000000000..763efef91 --- /dev/null +++ b/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/{{cookiecutter.library_name}}/__main__.py @@ -0,0 +1,7 @@ +"""{{ cookiecutter.name }} entry point.""" + +from __future__ import annotations + +from {{ cookiecutter.library_name }}.mapper import {{ cookiecutter.name }}Mapper + +{{ cookiecutter.name }}Mapper.cli() diff --git a/cookiecutter/tap-template/cookiecutter.json b/cookiecutter/tap-template/cookiecutter.json index 017b31109..4eae4d8ad 100644 --- a/cookiecutter/tap-template/cookiecutter.json +++ b/cookiecutter/tap-template/cookiecutter.json @@ -16,6 +16,7 @@ ], "include_ci_files": ["GitHub", "None"], "license": ["Apache-2.0", "None"], + "ide": ["VSCode", "None"], "__prompts__": { "source_name": "The name of the source, in CamelCase", "admin_name": "Provide your [bold yellow]full name[/]", @@ -25,6 +26,7 @@ "stream_type": "The type of stream the source provides", "auth_method": "The [bold red]authentication[/] method used by the source, for REST and GraphQL sources", "include_ci_files": "Whether to include CI files for a common CI services", - "license": "The license for the project" + "license": "The license for the project", + "ide": "Add configuration files for your preferred IDE" } } diff --git a/cookiecutter/tap-template/hooks/post_gen_project.py b/cookiecutter/tap-template/hooks/post_gen_project.py index 775a3e1ed..ca51924f2 100644 --- a/cookiecutter/tap-template/hooks/post_gen_project.py +++ b/cookiecutter/tap-template/hooks/post_gen_project.py @@ -26,3 +26,6 @@ if "{{ cookiecutter.include_ci_files }}" != "GitHub": shutil.rmtree(".github") + + if "{{ cookiecutter.ide }}" != "VSCode": + shutil.rmtree(".vscode") diff --git a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/{{cookiecutter.library_name}}/__main__.py b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/{{cookiecutter.library_name}}/__main__.py new file mode 100644 index 000000000..a302e899c --- /dev/null +++ b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/{{cookiecutter.library_name}}/__main__.py @@ -0,0 +1,7 @@ +"""{{ cookiecutter.source_name }} entry point.""" + +from __future__ import annotations + +from {{ cookiecutter.library_name }}.tap import Tap{{ cookiecutter.source_name }} + +Tap{{ cookiecutter.source_name }}.cli() diff --git a/cookiecutter/target-template/cookiecutter.json b/cookiecutter/target-template/cookiecutter.json index c7c31835a..2490a31db 100644 --- a/cookiecutter/target-template/cookiecutter.json +++ b/cookiecutter/target-template/cookiecutter.json @@ -8,6 +8,7 @@ "serialization_method": ["Per record", "Per batch", "SQL"], "include_ci_files": ["GitHub", "None (Skip)"], "license": ["Apache-2.0"], + "ide": ["VSCode", "None"], "__prompts__": { "name": "The name of the mapper, in CamelCase", "admin_name": "Provide your [bold yellow]full name[/]", @@ -16,6 +17,7 @@ "library_name": "The name of the library, in snake_case. This is how the library will be imported in Python.", "serialization_method": "The serialization method to use for loading data", "include_ci_files": "Whether to include CI files for a common CI services", - "license": "The license for the project" + "license": "The license for the project", + "ide": "Add configuration files for your preferred IDE" } } diff --git a/cookiecutter/target-template/hooks/post_gen_project.py b/cookiecutter/target-template/hooks/post_gen_project.py index 44edd337b..a700beb50 100644 --- a/cookiecutter/target-template/hooks/post_gen_project.py +++ b/cookiecutter/target-template/hooks/post_gen_project.py @@ -12,3 +12,6 @@ if "{{ cookiecutter.include_ci_files }}" != "GitHub": shutil.rmtree(Path(".github")) + + if "{{ cookiecutter.ide }}" != "VSCode": + shutil.rmtree(".vscode") diff --git a/cookiecutter/target-template/{{cookiecutter.target_id}}/{{cookiecutter.library_name}}/__main__.py b/cookiecutter/target-template/{{cookiecutter.target_id}}/{{cookiecutter.library_name}}/__main__.py new file mode 100644 index 000000000..77b325ec2 --- /dev/null +++ b/cookiecutter/target-template/{{cookiecutter.target_id}}/{{cookiecutter.library_name}}/__main__.py @@ -0,0 +1,7 @@ +"""{{ cookiecutter.destination_name }} entry point.""" + +from __future__ import annotations + +from {{ cookiecutter.library_name }}.target import Target{{ cookiecutter.destination_name }} + +Target{{ cookiecutter.destination_name }}.cli() diff --git a/e2e-tests/cookiecutters/mapper-base.json b/e2e-tests/cookiecutters/mapper-base.json index 390e8a7ba..01834631d 100644 --- a/e2e-tests/cookiecutters/mapper-base.json +++ b/e2e-tests/cookiecutters/mapper-base.json @@ -8,6 +8,7 @@ "variant": "None (Skip)", "include_ci_files": "None (Skip)", "license": "Apache-2.0", + "ide": "VSCode", "_template": "../mapper-template/", "_output_dir": "." } diff --git a/e2e-tests/cookiecutters/tap-graphql-jwt.json b/e2e-tests/cookiecutters/tap-graphql-jwt.json index 5daf4ab8f..28b3dfee4 100644 --- a/e2e-tests/cookiecutters/tap-graphql-jwt.json +++ b/e2e-tests/cookiecutters/tap-graphql-jwt.json @@ -10,6 +10,7 @@ "auth_method": "JWT", "include_ci_files": "None (Skip)", "license": "Apache-2.0", + "ide": "VSCode", "_template": "../tap-template/", "_output_dir": "." } diff --git a/e2e-tests/cookiecutters/tap-other-custom.json b/e2e-tests/cookiecutters/tap-other-custom.json index 3ea01eaf4..d0aabab09 100644 --- a/e2e-tests/cookiecutters/tap-other-custom.json +++ b/e2e-tests/cookiecutters/tap-other-custom.json @@ -10,6 +10,7 @@ "auth_method": "Custom or N/A", "include_ci_files": "None (Skip)", "license": "Apache-2.0", + "ide": "VSCode", "_template": "../tap-template/", "_output_dir": "." } diff --git a/e2e-tests/cookiecutters/tap-rest-api_key-github.json b/e2e-tests/cookiecutters/tap-rest-api_key-github.json index 01570aba8..cb162402a 100644 --- a/e2e-tests/cookiecutters/tap-rest-api_key-github.json +++ b/e2e-tests/cookiecutters/tap-rest-api_key-github.json @@ -10,6 +10,7 @@ "auth_method": "API Key", "include_ci_files": "GitHub", "license": "Apache-2.0", + "ide": "VSCode", "_template": "../tap-template/", "_output_dir": "." } diff --git a/e2e-tests/cookiecutters/tap-rest-basic_auth.json b/e2e-tests/cookiecutters/tap-rest-basic_auth.json index 6c7d7fa19..aa91e3c0d 100644 --- a/e2e-tests/cookiecutters/tap-rest-basic_auth.json +++ b/e2e-tests/cookiecutters/tap-rest-basic_auth.json @@ -10,6 +10,7 @@ "auth_method": "Basic Auth", "include_ci_files": "None (Skip)", "license": "Apache-2.0", + "ide": "VSCode", "_template": "../tap-template/", "_output_dir": "." } diff --git a/e2e-tests/cookiecutters/tap-rest-bearer_token.json b/e2e-tests/cookiecutters/tap-rest-bearer_token.json index 157457462..274039845 100644 --- a/e2e-tests/cookiecutters/tap-rest-bearer_token.json +++ b/e2e-tests/cookiecutters/tap-rest-bearer_token.json @@ -10,6 +10,7 @@ "auth_method": "Bearer Token", "include_ci_files": "None (Skip)", "license": "Apache-2.0", + "ide": "VSCode", "_template": "../tap-template/", "_output_dir": "." } diff --git a/e2e-tests/cookiecutters/tap-rest-custom.json b/e2e-tests/cookiecutters/tap-rest-custom.json index 831135b7a..67d72dea9 100644 --- a/e2e-tests/cookiecutters/tap-rest-custom.json +++ b/e2e-tests/cookiecutters/tap-rest-custom.json @@ -10,6 +10,7 @@ "auth_method": "Custom or N/A", "include_ci_files": "None (Skip)", "license": "Apache-2.0", + "ide": "VSCode", "_template": "../tap-template/", "_output_dir": "." } diff --git a/e2e-tests/cookiecutters/tap-rest-jwt.json b/e2e-tests/cookiecutters/tap-rest-jwt.json index b46807d49..aa3729388 100644 --- a/e2e-tests/cookiecutters/tap-rest-jwt.json +++ b/e2e-tests/cookiecutters/tap-rest-jwt.json @@ -10,6 +10,7 @@ "auth_method": "JWT", "include_ci_files": "None (Skip)", "license": "Apache-2.0", + "ide": "VSCode", "_template": "../tap-template/", "_output_dir": "." } diff --git a/e2e-tests/cookiecutters/tap-rest-oauth2.json b/e2e-tests/cookiecutters/tap-rest-oauth2.json index 4a41b80e3..905349aac 100644 --- a/e2e-tests/cookiecutters/tap-rest-oauth2.json +++ b/e2e-tests/cookiecutters/tap-rest-oauth2.json @@ -10,6 +10,7 @@ "auth_method": "OAuth2", "include_ci_files": "None (Skip)", "license": "Apache-2.0", + "ide": "VSCode", "_template": "../tap-template/", "_output_dir": "." } diff --git a/e2e-tests/cookiecutters/tap-sql-custom.json b/e2e-tests/cookiecutters/tap-sql-custom.json index 3c5996860..81ac625d0 100644 --- a/e2e-tests/cookiecutters/tap-sql-custom.json +++ b/e2e-tests/cookiecutters/tap-sql-custom.json @@ -10,6 +10,7 @@ "auth_method": "Custom or N/A", "include_ci_files": "None (Skip)", "license": "Apache-2.0", + "ide": "VSCode", "_template": "../tap-template/", "_output_dir": "." } diff --git a/e2e-tests/cookiecutters/target-per_record.json b/e2e-tests/cookiecutters/target-per_record.json index f5dde1cef..89f923911 100644 --- a/e2e-tests/cookiecutters/target-per_record.json +++ b/e2e-tests/cookiecutters/target-per_record.json @@ -9,6 +9,7 @@ "serialization_method": "Per record", "include_ci_files": "None (Skip)", "license": "Apache-2.0", + "ide": "VSCode", "_template": "./sdk/cookiecutter/target-template", "_output_dir": "." } diff --git a/e2e-tests/cookiecutters/target-sql.json b/e2e-tests/cookiecutters/target-sql.json index 63691d718..881b3ebe4 100644 --- a/e2e-tests/cookiecutters/target-sql.json +++ b/e2e-tests/cookiecutters/target-sql.json @@ -9,6 +9,7 @@ "serialization_method": "SQL", "include_ci_files": "None (Skip)", "license": "Apache-2.0", + "ide": "VSCode", "_template": "./sdk/cookiecutter/target-template", "_output_dir": "." } diff --git a/samples/sample_mapper/__main__.py b/samples/sample_mapper/__main__.py new file mode 100644 index 000000000..594c58871 --- /dev/null +++ b/samples/sample_mapper/__main__.py @@ -0,0 +1,5 @@ +from __future__ import annotations + +from samples.sample_mapper.mapper import StreamTransform + +StreamTransform.cli() diff --git a/samples/sample_tap_bigquery/__main__.py b/samples/sample_tap_bigquery/__main__.py new file mode 100644 index 000000000..04945c5db --- /dev/null +++ b/samples/sample_tap_bigquery/__main__.py @@ -0,0 +1,5 @@ +from __future__ import annotations + +from samples.sample_tap_bigquery import TapBigQuery + +TapBigQuery.cli() diff --git a/samples/sample_tap_gitlab/__main__.py b/samples/sample_tap_gitlab/__main__.py new file mode 100644 index 000000000..236b22a6a --- /dev/null +++ b/samples/sample_tap_gitlab/__main__.py @@ -0,0 +1,5 @@ +from __future__ import annotations + +from sample_tap_gitlab.gitlab_tap import SampleTapGitlab + +SampleTapGitlab.cli() diff --git a/samples/sample_tap_google_analytics/__main__.py b/samples/sample_tap_google_analytics/__main__.py new file mode 100644 index 000000000..e274833e6 --- /dev/null +++ b/samples/sample_tap_google_analytics/__main__.py @@ -0,0 +1,5 @@ +from __future__ import annotations + +from samples.sample_tap_google_analytics.ga_tap import SampleTapGoogleAnalytics + +SampleTapGoogleAnalytics.cli() diff --git a/samples/sample_tap_hostile/__main__.py b/samples/sample_tap_hostile/__main__.py new file mode 100644 index 000000000..83b94e0e1 --- /dev/null +++ b/samples/sample_tap_hostile/__main__.py @@ -0,0 +1,5 @@ +from __future__ import annotations + +from samples.sample_tap_hostile import SampleTapHostile + +SampleTapHostile.cli() diff --git a/samples/sample_tap_sqlite/__main__.py b/samples/sample_tap_sqlite/__main__.py new file mode 100644 index 000000000..e758e688d --- /dev/null +++ b/samples/sample_tap_sqlite/__main__.py @@ -0,0 +1,5 @@ +from __future__ import annotations + +from samples.sample_tap_sqlite import SQLiteTap + +SQLiteTap.cli() diff --git a/samples/sample_target_parquet/__main__.py b/samples/sample_target_parquet/__main__.py new file mode 100644 index 000000000..ee89a2954 --- /dev/null +++ b/samples/sample_target_parquet/__main__.py @@ -0,0 +1,5 @@ +from __future__ import annotations + +from sample_target_parquet.parquet_target import SampleTargetParquet + +SampleTargetParquet.cli()