-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (26 loc) · 956 Bytes
/
Makefile
File metadata and controls
33 lines (26 loc) · 956 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
# Defines the virtual environment directory
VENV_DIR = .venv
# Defines the Python interpreter from the virtual environment
PYTHON = $(VENV_DIR)/bin/python
# Prevents make from confusing the targets with files
.PHONY: setup-dev setup-prod test clean
# Default target
all: setup-dev
# Creates the virtual environment and installs development dependencies
setup-dev: $(VENV_DIR)/.setup-dev-complete
$(VENV_DIR)/.setup-dev-complete: pyproject.toml
test -d $(VENV_DIR) || python3 -m venv $(VENV_DIR)
$(PYTHON) -m pip install -e ".[dev]"
touch $(VENV_DIR)/.setup-dev-complete
# Creates the virtual environment and installs production dependencies
setup-prod:
test -d $(VENV_DIR) || python3 -m venv $(VENV_DIR)
$(PYTHON) -m pip install .
# Runs tests
test: setup-dev
$(PYTHON) -m pytest
# Removes the virtual environment and temporary files
clean:
rm -rf $(VENV_DIR)
find . -type f -name '*.pyc' -delete
find . -type d -name '__pycache__' -delete