Skip to content

Commit

Permalink
Get the code-quality check working again (#9621)
Browse files Browse the repository at this point in the history
Co-authored-by: Kshitij Aranke <[email protected]>
Co-authored-by: Kshitij Aranke <[email protected]>
  • Loading branch information
3 people authored Feb 23, 2024
1 parent d1e400e commit 12e40e2
Show file tree
Hide file tree
Showing 6 changed files with 742 additions and 728 deletions.
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,19 @@ CI_FLAGS =\
.PHONY: dev_req
dev_req: ## Installs dbt-* packages in develop mode along with only development dependencies.
@\
pip install -r dev-requirements.txt
pip install -r editable-requirements.txt
pip install -r dev-requirements.txt -r editable-requirements.txt

.PHONY: dev
dev: dev_req ## Installs dbt-* packages in develop mode along with development dependencies and pre-commit.
@\
pre-commit install

.PHONY: dev-uninstall
dev-uninstall: ## Uninstall all packages in venv except for build tools
@\
pip freeze | grep -v "^-e" | cut -d "@" -f1 | xargs pip uninstall -y; \
pip uninstall -y dbt-core

.PHONY: core_proto_types
core_proto_types: ## generates google protobuf python file from core_types.proto
protoc -I=./core/dbt/events --python_out=./core/dbt/events ./core/dbt/events/core_types.proto
Expand Down
2 changes: 1 addition & 1 deletion core/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
recursive-include dbt/adapters/include *.py *.sql *.yml *.html *.md .gitkeep .gitignore
recursive-include dbt/include *.py *.sql *.yml *.html *.md .gitkeep .gitignore
include dbt/py.typed
recursive-include dbt/task/docs *.html
1,441 changes: 721 additions & 720 deletions core/dbt/events/core_types_pb2.py

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions core/dbt/include/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from pkgutil import extend_path

__path__ = extend_path(__path__, __name__)
13 changes: 8 additions & 5 deletions core/dbt/task/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
ProjectCreated,
)

from dbt.include.starter_project import PACKAGE_PATH as starter_project_directory

from dbt.include.global_project import PROJECT_NAME as GLOBAL_PROJECT_NAME

from dbt.task.base import BaseTask, move_to_nearest_project_dir

DOCS_URL = "https://docs.getdbt.com/docs/configure-your-profile"
Expand All @@ -57,7 +53,10 @@


class InitTask(BaseTask):
def copy_starter_repo(self, project_name):
def copy_starter_repo(self, project_name: str) -> None:
# Lazy import to avoid ModuleNotFoundError
from dbt.include.starter_project import PACKAGE_PATH as starter_project_directory

fire_event(StarterProjectPath(dir=starter_project_directory))
shutil.copytree(
starter_project_directory, project_name, ignore=shutil.ignore_patterns(*IGNORE_FILES)
Expand Down Expand Up @@ -265,6 +264,10 @@ def setup_profile(self, profile_name: str) -> None:

def get_valid_project_name(self) -> str:
"""Returns a valid project name, either from CLI arg or user prompt."""

# Lazy import to avoid ModuleNotFoundError
from dbt.include.global_project import PROJECT_NAME as GLOBAL_PROJECT_NAME

name = self.args.project_name
internal_package_names = {GLOBAL_PROJECT_NAME}
available_adapters = list(_get_adapter_plugin_names())
Expand Down
2 changes: 2 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
git+https://github.com/dbt-labs/dbt-adapters.git@main
git+https://github.com/dbt-labs/dbt-adapters.git@main#subdirectory=dbt-tests-adapter
git+https://github.com/dbt-labs/dbt-common.git@main
git+https://github.com/dbt-labs/dbt-postgres.git@main
black==23.3.0
bumpversion
Expand Down

0 comments on commit 12e40e2

Please sign in to comment.