-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (34 loc) · 1.17 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
.PHONE: install run test unittest mypy ruff format isort clean
PROJECT_NAME=flexiagent
PYTHON=python3
MYPY=mypy
PIP=$(PYTHON) -m pip
.DEFAULT_GOAL := help
help: ## show this help.
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-15s %s\n", $$1, $$2}'
@echo ""
@echo "Default target is 'help', showing this message."
install: ## Install dependencies.
poetry install
run: ## Local run
$(PYTHON) $(PROJECT_NAME)/main.py
test: ## Run tests.
$(PYTHON) -m pytest -s tests/
unittest: ## Run unittest.
$(PYTHON) -s tests/test_text2sql_unittest.py
mypy: ## Run mypy checker
$(MYPY) --check-untyped-defs --ignore-missing-imports $(PROJECT_NAME)
ruff: ## Run ruff check
$(PYTHON) -m ruff check $(PROJECT_NAME)
format: ## Format project code.
$(PYTHON) -m ruff format $(PROJECT_NAME) examples tests
isort: ## Format imports
$(PYTHON) -m isort $(PROJECT_NAME) examples tests
$(PYTHON) -m ruff format $(PROJECT_NAME) examples tests
clean: ## Clean up build files.
@echo "Cleaning up..."
find . -type f -name '*.pyc' -delete
find . -type d -name '__pycache__' -exec rm -r {} +