-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
68 lines (48 loc) · 1.33 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
59
60
61
62
63
64
65
66
67
68
# Install pyenv and python 3.8.10
.PHONY: setup-linux
setup-linux:
sh -c 'sudo apt-get update'
sh -c 'sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl git'
sh -c 'curl https://pyenv.run | bash'
sh -c 'echo "export PATH="$HOME/.pyenv/bin:$PATH"" >> ~/.bashrc'
sh -c 'echo "eval "$(pyenv init -)"" >> ~/.bashrc'
sh -c 'echo "eval "$(pyenv virtualenv-init -)"" >> ~/.bashrc'
sh -c 'source ~/.bashrc'
sh -c 'pyenv install 3.8.10'
sh -c 'pyenv global 3.8.10'
# Create virtual environment
.PHONY: venv
venv:
sh -c 'python -m venv env'
# Activate virtual environment
.PHONY: activate
activate:
sh -c 'source env/Scripts/activate'
# Lint files
.PHONY: lint
lint:
sh -c 'black src'
sh -c 'isort src'
# Install requirements
.PHONY: install
install:
sh -c 'cd src && pip install -r requirements.txt'
# Run init script
.PHONY: init
init:
sh -c 'cd src && ./init.sh'
# Start application
.PHONY: start
start:
sh -c 'cd src && python app.py'
# Run tests
.PHONY: test
test:
sh -c 'cd src/tests && pytest . -W ignore::DeprecationWarning --verbose --html=report.html'
# Cleanup
.PHONY: clean
clean:
deactivate
sh -c 'rm -rf env'
# Default target
all: venv activate install init start