Skip to content

Commit

Permalink
Merge pull request dbt-labs#157 from dbt-labs/exclude-packages-in-con…
Browse files Browse the repository at this point in the history
…nect

filter out package paths, local and global
  • Loading branch information
dave-connors-3 authored Aug 30, 2023
2 parents 188df85 + 51fe4c3 commit 07a9082
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 3 additions & 1 deletion dbt_meshify/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ def connect(

if projects_dir:
dbt_project_paths = [
path.parent.resolve() for path in Path(projects_dir).glob("**/dbt_project.yml")
path.parent.resolve()
for path in Path(projects_dir).glob("**/dbt_project.yml")
if ("dbt_packages" not in path.parts and "site-packages" not in path.parts)
]
all_dbt_projects = [
DbtProject.from_directory(project_path, read_catalog)
Expand Down
3 changes: 3 additions & 0 deletions test-projects/source-hack/src_proj_a/packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packages:
- package: dbt-labs/dbt_utils
version: 1.1.1
11 changes: 8 additions & 3 deletions tests/integration/test_dependency_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ class TestLinkerSourceDependencies:
@pytest.fixture
def src_proj_a(self) -> DbtProject:
"""Load the `src_proj_a` project."""
return DbtProject.from_directory(
Path("test-projects/source-hack/src_proj_a/").resolve(), read_catalog=False
)

path = Path("test-projects/source-hack/src_proj_a/").resolve()

# Run `dbt deps` for this project so upstream projects are loaded.
dbt = Dbt()
dbt.invoke(path, ["deps"])

return DbtProject.from_directory(path, read_catalog=False)

@pytest.fixture
def src_proj_b(self) -> DbtProject:
Expand Down

0 comments on commit 07a9082

Please sign in to comment.