-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
42 lines (34 loc) · 1.27 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
export PIPENV_VENV_IN_PROJECT=true
export PYTHONPATH=src
export MYPYPATH=src
all: help
.PHONY: help
help:
@echo 'Available targets:'
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' | sed -e "s/| \(.*\)$$/| $$(printf "\033")[37m\1$$(printf "\033")[0m/g"
@printf '\nAvailable variables:\n'
@grep -E '^[a-zA-Z_-]+\?=.*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = "?="}; {printf "\033[36m%-20s\033[0m default: %s\n", $$1, $$2}'
.PHONY: build
build: ## Build the project
pipenv sync --bare
.PHONY: fmt
fmt: ## Format
pipenv run -- black src tests
pipenv run -- isort --profile black src tests
.PHONY: local
local: ## Starts local uvicorn
DRADIS_TOKEN=fake pipenv run -- uvicorn --reload --reload-dir src main:app
@echo 'Do not forget to pass the token using: "Authorization: Bearer fake"'
.PHONY: setup
setup:
pipenv sync --dev --bare
.PHONY: sh
sh: ## Open a pipenv shell
pipenv shell
.PHONY: test
test: setup ## Test the project | make test path=spec/spec_lifen.py
pipenv run -- black --check src tests
pipenv run -- isort --profile black --check-only src tests
pipenv run -- flake8 --append-config .flake8.conf src tests
# pipenv run -- mypy --explicit-package-bases .
pipenv run -- pytest