-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (36 loc) · 808 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
46
OS = mac
VENV=.venv
COMMIT_MESSAGE=
BRANCH=main
APP_NAME=
ifeq ($(OS), mac)
PYTHON = $(VENV)/bin/python
PIP = $(VENV)/bin/pip
SAFETY_CHECK = safety check -r requirements.txt
else
PYTHON = $(VENV)/Scripts/python
PIP = $(VENV)/Scripts/pip
endif
init:
touch requirements.txt
echo 'Add .gitignore'
run: $(VENV)/bin/activate
$(VENV)/bin/activate: requirements.txt
python -m venv $(VENV)
$(PIP) install -r requirements.txt
safety:
$(SAFETY_CHECK)
djangoinit:
django-admin startproject $(APP_NAME) .
update-requirements:
rm requirements.txt
$(PIP) freeze > requirements.txt
commit-push: update-requirements
git add --all
git commit -m "$(COMMIT_MESSAGE)"
git push pi $(BRANCH)
clean:
find . -type d -name __pycache__ -prune -exec rm -r {} +
rm -rf .idea
rm -rf .vscode
rm -rf logs