-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (34 loc) · 991 Bytes
/
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
.DEFAULT_GOAL=help
CONFIG_FILE=./.env
VENVPATH=venv
PYTHON=$(VENVPATH)/bin/python3
venv: $(VENVPATH)/bin/activate
$(VENVPATH)/bin/activate: requirements.txt
test -d $(VENVPATH) || virtualenv -p python3 $(VENVPATH); \
. $(VENVPATH)/bin/activate; \
pip install -U pip; \
pip install -r requirements.txt; \
touch $(VENVPATH)/bin/activate;
$(CONFIG_FILE):
echo "> Adding config file..."
cp .env.example $(CONFIG_FILE)
##install-deps: setup your dev environment
install-deps: venv $(CONFIG_FILE)
install-dev-deps: install-deps $(CONFIG_FILE)
$(PYTHON) -m pip install -r requirements-dev.txt
##run: run the api locally
run: install-deps
sudo $(PYTHON) -m opika.main
lint: venv
$(PYTHON) -m black opika
$(PYTHON) -m isort opika
$(PYTHON) -m flake8 opika --show-source --statistics
##test: test your code
test: install-deps lint
$(PYTHON) -m pytest
clean:
rm -rf $(VENVPATH)
##help: show help
help : Makefile
@sed -n 's/^##//p' $<
.PHONY : help venv install-deps test lint