forked from Akkudoktor-EOS/EOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (35 loc) · 1.28 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
# Define the targets
.PHONY: help venv pip docker-run docs clean
# Default target
all: help
# Target to display help information
help:
@echo "Available targets:"
@echo " venv - Set up a Python 3 virtual environment."
@echo " pip - Install dependencies from requirements.txt."
@echo " docker-run - Run entire setup on docker
@echo " docs - Generate HTML documentation using pdoc."
@echo " run - Run flask_server.py in the virtual environment."
@echo " clean - Remove generated documentation and virtual environment."
# Target to set up a Python 3 virtual environment
venv:
python3 -m venv .venv
@echo "Virtual environment created in '.venv'. Activate it using 'source .venv/bin/activate'."
# Target to install dependencies from requirements.txt
pip: venv
.venv/bin/pip install -r requirements.txt
@echo "Dependencies installed from requirements.txt."
# Target to generate HTML documentation
docs: pip
pdoc --html --force modules -o docs
# Clean target to remove generated documentation and virtual environment
clean:
@echo "Cleaning virtual env and documentation directories"
rm -rf docs
rm -rf .venv
run:
@echo "Starting flask server, please wait..."
.venv/bin/python ./flask_server.py
# Run entire setup on docker
docker-run:
@docker compose up