-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmakefile
More file actions
40 lines (33 loc) · 1.13 KB
/
makefile
File metadata and controls
40 lines (33 loc) · 1.13 KB
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: setup_venv compile_dependencies install_dependencies test clean
# set the name of the venv
VENV = venv
# creates a venv, if it doesn't exist locally
setup_venv:
@echo "Creating virtual environment."
if [ -d $(VENV) ]; then \
echo "Virtual environment already exists."; \
exit 1; \
fi
python -m venv $(VENV)
@echo "Activating virtual environment."
. $(VENV)/bin/activate; pip install --upgrade pip
# create a requirements.txt file, from the dependencies in the pyproject.toml file
compile_dependencies: setup_venv
@echo "Compiling dependencies in a requirements.txt ."
pip install poetry poetry-plugin-export
poetry config warnings.export false
poetry export -f requirements.txt --output requirements.txt
# install dependencies from requirements.txt
install_dependencies:
@echo "Installing dependencies."
. $(VENV)/bin/activate; pip install -r requirements.txt
# running the available tests
test:
@echo "Running tests."
. $(VENV)/bin/activate; python -m unittest discover -s tests
# remove venv
clean:
@echo "Cleaning up."
rm -rf $(VENV)
find . -type f -name '*.pyc' -delete
find . -type d -name '__pycache__' -delete