-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
111 lines (93 loc) · 2.68 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
install:
echo "[Info] - Creating virtualenv"; \
python3 -m venv .venv; \
echo "[Info] - Activating virtualenv"; \
. .venv/bin/activate; \
echo "[Info] - Installing requirements"; \
pip3 install -r requirements.txt; \
echo "Done"; \
echo "[Info] - Run Unit Tests (pytest)"; \
pytest; \
echo "Docker-compose down and up"; \
docker-compose down && docker-compose up -d; \
echo "cd services/nuxt3-shadcn && yarn install && yarn dev --open"; \
cd services/nuxt3-shadcn && yarn install && yarn dev --open; \
echo "Done"; \
uninstall:
echo "[Info] - Removing virtualenv"; \
rm -rf .venv; \
echo "Done"; \
reinstall:
echo "[Info] - Reinstalling project"; \
make uninstall; \
make install; \
echo "Done"; \
upgrade:
echo "[Info] - Upgrading project"; \
pip3 install -r requirements.txt --upgrade; \
echo "Done"; \
freeze:
echo "[Info] - Backing up requirements"; \
mkdir -p .backups; \
cp requirements.txt .backups/requirements.txt; \
echo "[Info] - Freezing project"; \
pip3 freeze > requirements.txt; \
echo "Done"; \
test:
echo "[Info] - Running tests"; \
python3 -m unittest discover -s tests -p 'test_*.py'; \
clean:
echo "[Info] - This command removes the virtual environment folder, the database file, and the log file. if they exist"; \
if [ -d "venv" ]; then rm -rf .venv; fi; \
if [ -f "app/data/Python_SQLite.db" ]; then rm app/data/Python_SQLite.db; fi; \
if [ -f "app.log" ]; then rm app.log; fi; \
if [ -d "htmlcov" ]; then rm -rf htmlcov; fi; \
echo "Done"; \
run:
@echo "[Info] - Running project"
@python3 app/main.py
coverage:
@echo "[Info] - Running coverage"
@python3 -m unittest discover -s tests -p 'test_*.py' -v
@coverage run -m unittest discover -s tests -p 'test_*.py'
@coverage html --include app/* --omit tests/*
@echo "Done"
DIRECTORY=documents/docs
BUILDDIR=$(DIRECTORY)/build
FILENAME=$(DIRECTORY)/HoppyBrew.rmd
BIBFILENAME=documents/bibliography.bib
MARKDOWNDIR=$(DIRECTORY)/chapters_markdown
pdf:
python3 tools/MarkdownToPdf.py
git:
git add .
git commit -m "Update"
git push
doc:
@make pdf
@make git
all:
@echo "[Clean] - Cleaning project"
@make clean
@echo "[Install] - Installing project"
@make install
@echo "[Test] - Running tests"
@make test
@echo "[Coverage] - Running coverage"
@make coverage
@echo "[Doc] - Generating documentation"
@make doc
@echo "Done"
help:
@echo "install - install project"
@echo "test - run tests"
@echo "clean - clean project"
@echo "run - run project"
@echo "coverage - run coverage"
@echo "doc - generate documentation"
@echo "all - run all commands"
@echo "help - show this message and exit"
requirements:
@echo "[Info] - Installing requirements"
@pip3 install -r requirements.txt
@echo "Done"