Skip to content

Commit

Permalink
Move files to package
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Aug 1, 2024
1 parent f94cf94 commit 3942c63
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions dbt_ext/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
from meltano.edk.process import Invoker, log_subprocess_error
from meltano.edk.types import ExecArg

from . import files

try:
from importlib.resources import files as ir_files
from importlib import resources
except ImportError:
from importlib_resources import files as ir_files
import importlib_resources as resources

log = structlog.get_logger()

Expand Down Expand Up @@ -130,7 +132,9 @@ def initialize(self, force: bool = False) -> None:
log.info("creating dbt project directory", path=self.dbt_project_dir)
self.dbt_project_dir.mkdir(parents=True, exist_ok=True)

for entry in ir_files("files_dbt_ext.bundle.transform").iterdir():
files_dir = resources.files(files)

for entry in files_dir.joinpath("bundle", "transform").iterdir():
if entry.name == "__pycache__":
continue
log.debug(f"deploying {entry.name}", entry=entry, dst=self.dbt_project_dir)
Expand All @@ -145,7 +149,7 @@ def initialize(self, force: bool = False) -> None:
log.info("creating dbt profiles directory", path=self.dbt_profiles_dir)
self.dbt_profiles_dir.mkdir(parents=True, exist_ok=True)

for entry in ir_files("files_dbt_ext.profiles").iterdir():
for entry in files_dir.joinpath("profiles").iterdir():
if entry.name == self.dbt_ext_type and entry.is_dir():
log.debug(
f"deploying {entry.name} profile",
Expand Down
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.

0 comments on commit 3942c63

Please sign in to comment.