diff --git a/cookiecutter/tap-template/cookiecutter.json b/cookiecutter/tap-template/cookiecutter.json index 243a3d589..0635a6c02 100644 --- a/cookiecutter/tap-template/cookiecutter.json +++ b/cookiecutter/tap-template/cookiecutter.json @@ -1,24 +1,17 @@ { - "source_name": "MySourceName", - "admin_name": "FirstName LastName", - "tap_id": "tap-{{ cookiecutter.source_name.lower() }}", - "library_name": "{{ cookiecutter.tap_id.replace('-', '_') }}", - "stream_type": [ - "REST", - "GraphQL", - "SQL", - "Other" - ], - "auth_method": [ - "API Key", - "Bearer Token", - "Basic Auth", - "OAuth2", - "JWT", - "Custom or N/A" - ], - "include_cicd_sample_template": [ - "GitHub", - "None (Skip)" - ] + "source_name": "MySourceName", + "admin_name": "FirstName LastName", + "tap_id": "tap-{{ cookiecutter.source_name.lower() }}", + "library_name": "{{ cookiecutter.tap_id.replace('-', '_') }}", + "variant": "None (Skip)", + "stream_type": ["REST", "GraphQL", "SQL", "Other"], + "auth_method": [ + "API Key", + "Bearer Token", + "Basic Auth", + "OAuth2", + "JWT", + "Custom or N/A" + ], + "include_cicd_sample_template": ["GitHub", "None (Skip)"] } diff --git a/cookiecutter/tap-template/cookiecutter.tests.yml b/cookiecutter/tap-template/cookiecutter.tests.yml index 11e17f8ef..eb6a2d832 100644 --- a/cookiecutter/tap-template/cookiecutter.tests.yml +++ b/cookiecutter/tap-template/cookiecutter.tests.yml @@ -57,3 +57,10 @@ tests: stream_type: Other auth_method: Custom or N/A include_cicd_sample_template: GitHub + + - source_name: OtherCustomTemplateTest + tap_id: test-tap-other-custom-type + variant: meltanolabs + stream_type: Other + auth_method: Custom or N/A + include_cicd_sample_template: "None (Skip)" \ No newline at end of file diff --git a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/pyproject.toml b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/pyproject.toml index 349d928ca..10e1922e7 100644 --- a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/pyproject.toml +++ b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/pyproject.toml @@ -1,13 +1,23 @@ [tool.poetry] +{%- if cookiecutter.variant != "None (Skip)" %} +name = "{{cookiecutter.variant}}-{{cookiecutter.tap_id}}" +{%- else %} name = "{{cookiecutter.tap_id}}" +{%- endif %} version = "0.0.1" description = "`{{cookiecutter.tap_id}}` is a Singer tap for {{cookiecutter.source_name}}, built with the Meltano Singer SDK." +readme = "README.md" authors = ["{{ cookiecutter.admin_name }}"] keywords = [ "ELT", "{{cookiecutter.source_name}}", ] license = "Apache 2.0" +{%- if cookiecutter.variant != "None (Skip)" %} +packages = [ + { include = "{{cookiecutter.library_name}}" }, +] +{%- endif %} [tool.poetry.dependencies] python = "<3.12,>=3.7.1" diff --git a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/{{cookiecutter.library_name}}/tap.py b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/{{cookiecutter.library_name}}/tap.py index e41c337d7..ca508aae3 100644 --- a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/{{cookiecutter.library_name}}/tap.py +++ b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/{{cookiecutter.library_name}}/tap.py @@ -30,6 +30,7 @@ class Tap{{ cookiecutter.source_name }}({{ 'SQL' if cookiecutter.stream_type == 'SQL' else '' }}Tap): """{{ cookiecutter.source_name }} tap class.""" + name = "{{ cookiecutter.tap_id }}" # TODO: Update this section with the actual config values you expect: diff --git a/cookiecutter/target-template/cookiecutter.json b/cookiecutter/target-template/cookiecutter.json index c07a7ac6a..fc17807c4 100644 --- a/cookiecutter/target-template/cookiecutter.json +++ b/cookiecutter/target-template/cookiecutter.json @@ -1,7 +1,8 @@ { - "destination_name": "MyDestinationName", - "admin_name": "FirstName LastName", - "target_id": "target-{{ cookiecutter.destination_name.lower() }}", - "library_name": "{{ cookiecutter.target_id.replace('-', '_') }}", - "serialization_method": ["Per record", "Per batch", "SQL"] -} \ No newline at end of file + "destination_name": "MyDestinationName", + "admin_name": "FirstName LastName", + "target_id": "target-{{ cookiecutter.destination_name.lower() }}", + "library_name": "{{ cookiecutter.target_id.replace('-', '_') }}", + "variant": "None (Skip)", + "serialization_method": ["Per record", "Per batch", "SQL"] +} diff --git a/cookiecutter/target-template/cookiecutter.tests.yml b/cookiecutter/target-template/cookiecutter.tests.yml index 514f220bf..e0747fe8f 100644 --- a/cookiecutter/target-template/cookiecutter.tests.yml +++ b/cookiecutter/target-template/cookiecutter.tests.yml @@ -8,3 +8,7 @@ tests: - destination_name: SQLSinkTest target_id: target-sqlsink-test serialization_method: SQL + - destination_name: TargetRecordSinkTest + target_id: target-recordsink-test + variant: meltanolabs + serialization_method: Per record \ No newline at end of file diff --git a/cookiecutter/target-template/{{cookiecutter.target_id}}/pyproject.toml b/cookiecutter/target-template/{{cookiecutter.target_id}}/pyproject.toml index 1d6cb8068..2aaf88952 100644 --- a/cookiecutter/target-template/{{cookiecutter.target_id}}/pyproject.toml +++ b/cookiecutter/target-template/{{cookiecutter.target_id}}/pyproject.toml @@ -1,13 +1,23 @@ [tool.poetry] +{%- if cookiecutter.variant != "None (Skip)" %} +name = "{{cookiecutter.variant}}-{{cookiecutter.target_id}}" +{%- else %} name = "{{cookiecutter.target_id}}" +{%- endif %} version = "0.0.1" description = "`{{cookiecutter.target_id}}` is a Singer target for {{cookiecutter.destination_name}}, built with the Meltano Singer SDK." +readme = "README.md" authors = ["{{ cookiecutter.admin_name }}"] keywords = [ "ELT", "{{cookiecutter.destination_name}}", ] license = "Apache 2.0" +{%- if cookiecutter.variant != "None (Skip)" %} +packages = [ + { include = "{{cookiecutter.library_name}}" }, +] +{%- endif %} [tool.poetry.dependencies] python = "<3.12,>=3.7.1" diff --git a/cookiecutter/target-template/{{cookiecutter.target_id}}/{{cookiecutter.library_name}}/target.py b/cookiecutter/target-template/{{cookiecutter.target_id}}/{{cookiecutter.library_name}}/target.py index 35b4a4675..ac4299abb 100644 --- a/cookiecutter/target-template/{{cookiecutter.target_id}}/{{cookiecutter.library_name}}/target.py +++ b/cookiecutter/target-template/{{cookiecutter.target_id}}/{{cookiecutter.library_name}}/target.py @@ -16,6 +16,7 @@ class Target{{ cookiecutter.destination_name }}({{ target_class }}): """Sample target for {{ cookiecutter.destination_name }}.""" name = "{{ cookiecutter.target_id }}" + config_jsonschema = th.PropertiesList( {%- if cookiecutter.serialization_method == "SQL" %} th.Property(