-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
54 lines (42 loc) · 1.35 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
.PHONY: format lint clean clean-all clean-models clean-db install run venv
# Default paths and commands
PYTHON = python3.10
VENV = .venv
VENV_BIN = $(VENV)/bin
PIP = $(VENV_BIN)/pip
BLACK = $(VENV_BIN)/black
# Source directories and files
SRC_DIRS = src
PYTHON_FILES = main.py $(shell find $(SRC_DIRS) -name "*.py")
venv:
$(PYTHON) -m venv $(VENV)
$(VENV_BIN)/pip install --upgrade pip
install: venv
$(PIP) install -r requirements.txt
format:
$(BLACK) $(PYTHON_FILES)
lint:
$(BLACK) --check $(PYTHON_FILES)
clean:
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
clean-models:
rm -rf models_cache
clean-db:
rm -f rag_milvus.db .rag_milvus.db.lock
clean-all: clean clean-models clean-db
rm -rf $(VENV)
run:
$(VENV_BIN)/python main.py
.DEFAULT_GOAL := help
help:
@echo "Available commands:"
@echo " venv - Create Python virtual environment"
@echo " install - Create venv and install required dependencies"
@echo " format - Format code using black"
@echo " lint - Check code formatting using black"
@echo " clean - Remove Python cache files"
@echo " clean-db - Remove Milvus DB files"
@echo " clean-models- Remove downloaded model cache"
@echo " clean-all - Remove Python cache files, model cache, DB files, and venv"
@echo " run - Run the main application"