generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
49 lines (39 loc) · 1.12 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
VENV := .venv
# Format Python code with ruff format
.PHONY: format
format:
@echo "Formatting Python files with ruff format..."
$(VENV)/bin/ruff format
# Run ruff check to lint Python code in the whole repository
.PHONY: lint
lint:
@echo "Linting Python files with ruff check..."
$(VENV)/bin/ruff check
# Perform type checking
.PHONY: type-check
type-check:
@echo "Running type checking with mypy..."
$(VENV)/bin/mypy --strict ./inference_perf
# Check for and install dependencies
.PHONY: all-deps
all-deps: install-deps install-dev-deps
.PHONY:
install-deps:
@echo "Creating virtual environment if it doesn't exist..."
@if [ ! -d $(VENV) ]; then \
python3 -m venv $(VENV); \
fi
@echo "Activating virtual environment and installing dependencies..."
$(VENV)/bin/pip install --upgrade pip
$(VENV)/bin/pip install -e .
.PHONY:
install-dev-deps: install-deps
@echo "Installing development dependencies..."
$(VENV)/bin/pip install -e .[dev]
.PHONY: unit-test
unit-test: install-dev-deps
$(VENV)/bin/pytest
.PHONY: validate
validate: install-dev-deps format lint type-check
.PHONY: test
test: install-dev-deps unit-test