generated from tomasanchez/cosmic-fastapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (42 loc) · 1.44 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
.DEFAULT_GOAL = help
.NOTPARALLEL: ; # Targets execute serially
.ONESHELL: ; # Recipes execute in the same shell
.PHONY: clean
clean: ## Removes all build and test artifacts
rm -f .coverage
rm -rf .mypy_cache
rm -rf .pytest_cache
rm -rf dist
rm -rf reports
rm -f requirements.txt
rm -rf $(SSAP_DIR)
.PHONY: dist-clean
dist-clean: clean ## Removes all build and test artifacts and virtual environment
rm -rf .venv
.PHONY: build
build: ## Creates a virtual environment and installs development dependencies
poetry install
poetry run spacy download es_core_news_lg
.PHONY: deploy
deploy: build ## Build the application, trains the model and migrates the database
poetry run python -m heimdallr.train
poetry run python -m heimdallr.db.migration
.PHONY: test
test: ## Executes tests cases
poetry run pytest
.PHONY: cover
cover: ## Executes tests cases with coverage reports
poetry run pytest --cov . --junitxml reports/xunit.xml \
--cov-report xml:reports/coverage.xml --cov-report term-missing
.PHONY: lint
lint: ## Applies static analysis, checks and code formatting
poetry run pre-commit run --all-files
.PHONY: ci-prebuild
ci-prebuild: ## Install build tools and prepare project directory for the CI pipeline
pip install --disable-pip-version-check poetry
cat /dev/null > requirements.txt
.PHONY: help
help: ## Show make target documentation
@awk -F ':|##' '/^[^\t].+?:.*?##/ {\
printf "\033[36m%-30s\033[0m %s\n", $$1, $$NF \
}' $(MAKEFILE_LIST)