From c8e246133088e74f8600ed70e0e17058bf4578c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= <16805946+edgarrmondragon@users.noreply.github.com> Date: Mon, 29 Jan 2024 16:45:15 -0600 Subject: [PATCH] fix(templates): Include empty `schemas` directory in REST tap cookiecutter (#2195) --- cookiecutter/tap-template/hooks/post_gen_project.py | 3 +++ .../{{cookiecutter.library_name}}/schemas/__init__.py | 1 + 2 files changed, 4 insertions(+) create mode 100644 cookiecutter/tap-template/{{cookiecutter.tap_id}}/{{cookiecutter.library_name}}/schemas/__init__.py diff --git a/cookiecutter/tap-template/hooks/post_gen_project.py b/cookiecutter/tap-template/hooks/post_gen_project.py index dc7134238..05044d490 100644 --- a/cookiecutter/tap-template/hooks/post_gen_project.py +++ b/cookiecutter/tap-template/hooks/post_gen_project.py @@ -15,6 +15,9 @@ for client_py in PACKAGE_PATH.rglob("*-client.py"): client_py.unlink() + if "{{ cookiecutter.stream_type }}" != "REST": + shutil.rmtree(PACKAGE_PATH.joinpath("schemas"), ignore_errors=True) + if "{{ cookiecutter.auth_method }}" not in ("OAuth2", "JWT"): PACKAGE_PATH.joinpath("auth.py").unlink() diff --git a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/{{cookiecutter.library_name}}/schemas/__init__.py b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/{{cookiecutter.library_name}}/schemas/__init__.py new file mode 100644 index 000000000..06c0a1988 --- /dev/null +++ b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/{{cookiecutter.library_name}}/schemas/__init__.py @@ -0,0 +1 @@ +"""JSON schema files for the REST API."""