-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (30 loc) · 834 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
VENV_NAME := venv
PYTHON := python3
PIP := $(VENV_NAME)/bin/pip
REQUIREMENTS := requirements.txt
# Default target
.PHONY: all
all: venv vector_db
# Create virtual environment and install requirements
.PHONY: venv
venv: $(VENV_NAME)/bin/activate
$(VENV_NAME)/bin/activate: $(REQUIREMENTS)
$(PYTHON) -m venv $(VENV_NAME)
$(PIP) install -r $(REQUIREMENTS)
touch $(VENV_NAME)/bin/activate
vector_db:
mkdir vector_db
# Clean up
.PHONY: clean
clean:
rm -rf $(VENV_NAME)
# Install a new package and add it to requirements.txt
.PHONY: add
add:
@read -p "Enter package name: " package; \
$(PIP) install $$package && $(PIP) freeze | grep -i $$package >> $(REQUIREMENTS)
.PHONY: install-requirements
install-requirements:
$(PIP) install -r $(REQUIREMENTS)
test: venv
./venv/bin/$(PYTHON) -m unittest test_runnable_parsers.py