-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (56 loc) · 1.51 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
PACKAGE := foneplatform
SHELL=/bin/bash
VENV=.venv
ifeq ($(OS),Windows_NT)
VENV_BIN=$(VENV)/Scripts
else
VENV_BIN=$(VENV)/bin
endif
.venv: ## Set up Python virtual environment and install requirements
python -m venv $(VENV)
$(MAKE) requirements
.PHONY: requirements
requirements: .venv ## Install/refresh Python project requirements
$(VENV_BIN)/python -m pip install --upgrade uv
$(VENV_BIN)/uv pip install --editable .[dev]
"$(VENV_BIN)/dbt" deps --project-dir="./dbt" --profiles-dir="./dbt"
.PHONY: build
build:
$(VENV_BIN)/uv pip install build
$(VENV_BIN)/python -m build
.PHONY: dagster
dagster:
$(MAKE) dbt-parse
"$(VENV_BIN)/dagster" dev
.PHONY: dbt
dbt:
"$(VENV_BIN)/dbt" build --project-dir="./dbt" --profiles-dir="./dbt"
.PHONY: dbt-parse
dbt-parse:
"$(VENV_BIN)/dbt" parse --project-dir="./dbt" --profiles-dir="./dbt"
.PHONY: doc
doc:
"$(VENV_BIN)/dbt" docs generate --project-dir="./dbt" --profiles-dir="./dbt"
"$(VENV_BIN)/dbt" docs serve --project-dir="./dbt" --profiles-dir="./dbt"
.PHONY: format
format:
$(VENV_BIN)/ruff check $(PACKAGE) --fix
$(VENV_BIN)/ruff format $(PACKAGE)
$(VENV_BIN)/sqlfluff fix dbt/models
.PHONY: lint
lint:
$(VENV_BIN)/ruff check $(PACKAGE)
$(VENV_BIN)/ruff format $(PACKAGE) --check
$(VENV_BIN)/mypy $(PACKAGE)
.PHONY: lint-sql
lint-sql:
mkdir -p data
$(VENV_BIN)/sqlfluff lint dbt/models --processes 4
.PHONY: load
load:
$(MAKE) dbt-parse
"$(VENV_BIN)/dagster" job execute -m "foneplatform" -j "ergast_job"
.PHONY: test
test:
$(MAKE) lint
$(MAKE) lint-sql