-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
40 lines (31 loc) · 974 Bytes
/
makefile
File metadata and controls
40 lines (31 loc) · 974 Bytes
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
.PHONY: venv install test clean
# Define the virtual environment directory
VENV_DIR = venv
# Define the test directory
TEST_DIR = tests
# Define the Python interpreter to use for the virtual environment
PYTHON = python3
# Define the requirements file
REQUIREMENTS = requirements.txt
# Target to create the virtual environment
venv:
if [ -d $(VENV) ]; then \
exit 1;
fi
$(PYTHON) -m venv $(VENV_DIR)
. $(VENV_DIR)/bin/activate; pip install --upgrade pip
compile: venv
pip install poetry poetry-plugin-export
poetry config warnings.export false
poetry export -f requirements.txt --output requirements.txt
# Target to install dependencies
install: venv
. $(VENV_DIR)/bin/pip install -r $(REQUIREMENTS)
# Target to run tests
test: install
. $(VENV_DIR)/bin/activate; $(PYTHON) -m unittest discover -s $(TEST_DIR)
# Target to clean up the environment
clean:
rm -rf $(VENV)
find . -type f -name '*.pyc' -delete
find . -type d -name '__pycache__' -delete