-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (42 loc) · 1.1 KB
/
Makefile
File metadata and controls
57 lines (42 loc) · 1.1 KB
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
# PYTHON ?= python3
# VENV ?= .venv
# PIP = $(VENV)/bin/pip
# FLASK_APP = run.py
# .PHONY: help venv install run migrate test
# help:
# \t@echo "Common commands:"
# \t@echo " make venv - create virtualenv"
# \t@echo " make install - install dependencies"
# \t@echo " make migrate - create DB tables"
# \t@echo " make run - run API locally"
# \t@echo " make test - run unit tests"
# venv:
# \t$(PYTHON) -m venv $(VENV)
# install: venv
# \t$(PIP) install -r requirements.txt
# \t$(PIP) install pytest
# migrate:
# \t$(VENV)/bin/python -m migrations.create_tables
# run:
# \tFLASK_ENV=development $(VENV)/bin/python run.py
# test:
# \t$(VENV)/bin/pytest
PYTHON ?= python3
VENV ?= .venv
PIP = $(VENV)/bin/pip
.PHONY: venv install migrate run test
venv:
$(PYTHON) -m venv $(VENV)
install: venv
$(PIP) install -r requirements.txt
migrate:
@echo "DB Migration in progress..."
$(VENV)/bin/python migrations/create_tables.py
run:
@echo "Starting App..."
FLASK_ENV=development $(VENV)/bin/python run.py
# test:
# $(VENV)/bin/pytest
test:
@echo "Running tests..."
PYTHONPATH=. $(VENV)/bin/pytest