-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy Makefile test infrastructure from
dbt-snowflake
and update docs
- Loading branch information
1 parent
3b13594
commit d634515
Showing
3 changed files
with
84 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
.DEFAULT_GOAL:=help | ||
|
||
.PHONY: dev | ||
dev: ## Installs adapter in develop mode along with development dependencies | ||
@\ | ||
pip install -e . -r dev-requirements.txt && pre-commit install | ||
|
||
.PHONY: dev-uninstall | ||
dev-uninstall: ## Uninstalls all packages while maintaining the virtual environment | ||
## Useful when updating versions, or if you accidentally installed into the system interpreter | ||
pip freeze | grep -v "^-e" | cut -d "@" -f1 | xargs pip uninstall -y | ||
pip uninstall -y dbt-mysql | ||
|
||
.PHONY: flake8 | ||
flake8: ## Runs flake8 against staged changes to enforce style guide. | ||
@\ | ||
pre-commit run --hook-stage manual flake8-check | grep -v "INFO" | ||
|
||
.PHONY: lint | ||
lint: ## Runs flake8 code checks against staged changes. | ||
@\ | ||
pre-commit run flake8-check --hook-stage manual | grep -v "INFO"; | ||
|
||
.PHONY: linecheck | ||
linecheck: ## Checks for all Python lines 100 characters or more | ||
@\ | ||
find dbt -type f -name "*.py" -exec grep -I -r -n '.\{100\}' {} \; | ||
|
||
.PHONY: unit | ||
unit: ## Runs unit tests with py38. | ||
@\ | ||
tox -e py38 | ||
|
||
.PHONY: test | ||
test: ## Runs unit tests with py38 and code checks against staged changes. | ||
@\ | ||
tox -p -e py38; \ | ||
pre-commit run flake8-check --hook-stage manual | grep -v "INFO"; | ||
|
||
.PHONY: integration | ||
integration: ## Runs mysql integration tests with py38. | ||
@\ | ||
tox -e py38-mysql --; \ | ||
tox -e py38-mysql5 --; \ | ||
tox -e py38-mariadb --; | ||
|
||
.PHONY: clean | ||
@echo "cleaning repo" | ||
@git clean -f -X | ||
|
||
.PHONY: help | ||
help: ## Show this help message. | ||
@echo 'usage: make [target]' | ||
@echo | ||
@echo 'targets:' | ||
@grep -E '^[7+a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters