Get the code-quality check working again (#9621)

Co-authored-by: Kshitij Aranke <kshitij.aranke@dbtlabs.com>
Co-authored-by: Kshitij Aranke <kshitij@aranke.org>
This commit is contained in:
Mike Alfare
2024-02-23 12:52:52 -05:00
committed by GitHub
parent d1e400eed2
commit 12e40e2581
6 changed files with 742 additions and 728 deletions

View File

@@ -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

View File

@@ -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

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)

View File

@@ -32,10 +32,6 @@ from dbt.events.types import (
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"
@@ -57,7 +53,10 @@ click_type_mapping = {
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)
@@ -265,6 +264,10 @@ class InitTask(BaseTask):
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())

View File

@@ -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