-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (39 loc) · 1.21 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
.PHONY: setup install clean distclean package test
# Configurable paths and settings
VENV := _venv
PYTHON := $(VENV)/bin/python
PIP := $(VENV)/bin/pip
MODULE := hsm_secrets
DEPS_SRC := ""
PY_SRC := $(wildcard *.py) $(wildcard $(MODULE)/*.py) $(wildcard $(MODULE)/**/*.py) #$(DEPS_SRC)
TARGET_BINS := $(VENV)/bin/hsm-secrets
$(TARGET_BINS): $(VENV) $(PY_SRC) $(VENV)/bin/mypy
@echo "Verifying with mypy..."
$(VENV)/bin/mypy $(MODULE) --ignore-missing-imports
@echo "Installing the application..."
$(PIP) install -e .
@echo ""
@echo "-- Done. You can now run the application with: --"
echo "$(TARGET_BINS)"
$(VENV)/bin/mypy: $(VENV)
@$(PIP) install mypy==1.9.0
@touch $@
install: $(TARGET_BINS)
package: $(TARGET_BINS)
@echo "Packaging the application..."
@$(PYTHON) -m build --sdist
$(VENV): requirements.txt
@echo "Setting up virtual environment..."
python3 -m venv $(VENV)
$(PIP) install -U pip
$(PIP) install -r requirements.txt
$(PIP) install build
@touch $(VENV)
test: $(TARGET_BINS)
./run-tests.sh
clean:
@echo "Cleaning up build and Python file artifacts..."
@rm -rf $(VENV)
@rm -rf deps build dist *.egg-info dist_deb
@find . -type f -name '*.pyc' -delete
@find . -type d -name '__pycache__' -delete