-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Makefile
58 lines (42 loc) · 1.82 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
.PHONY: all format format_diff spell_check spell_fix tests integration docs help
all: help ## default target executed when no arguments are given to make
#############################
# UNIT AND INTEGRATION TESTS
#############################
UNIT_TESTS_DIR ?= tests/unit_tests/
INTEGRATION_TESTS_DIR ?= tests/integration_tests/
tests: ## run unit tests
poetry run pytest $(UNIT_TESTS_DIR)
integration: ## run integration tests
poetry run pytest $(INTEGRATION_TESTS_DIR)
coverage: ## run unit tests and generate coverage report
poetry run coverage run --source=pandasai -m pytest $(UNIT_TESTS_DIR)
poetry run coverage xml
###########################
# SPELLCHECK AND FORMATTING
###########################
IGNORE_FORMATS ?= "*.csv,*.txt,*.lock,*.log"
format: ## run code formatters
poetry run ruff format pandasai examples tests
poetry run ruff --select I --fix pandasai examples tests
format_diff: ## run code formatters in diff mode
poetry run ruff format pandasai examples tests --diff
poetry run ruff --select I pandasai examples tests
spell_check: ## run codespell on the project
poetry run codespell --toml pyproject.toml --ignore-words=ignore-words.txt --skip=$(IGNORE_FORMATS)
spell_fix: ## run codespell on the project and fix the errors
poetry run codespell --toml pyproject.toml --ignore-words=ignore-words.txt --skip=$(IGNORE_FORMATS) -w
######################
# DOCS
######################
docs: ## run docs serving
mkdocs serve
######################
# HELP
######################
help: ## show this help message for each Makefile recipe
ifeq ($(OS),Windows_NT)
@findstr /R /C:"^[a-zA-Z0-9 -]\+:.*##" $(MAKEFILE_LIST) | awk -F ':.*##' '{printf "\033[1;32m%-15s\033[0m %s\n", $$1, $$2}' | sort
else
@awk -F ':.*##' '/^[^ ]+:[^:]+##/ {printf "\033[1;32m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
endif