-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (56 loc) · 1.86 KB
/
Makefile
File metadata and controls
67 lines (56 loc) · 1.86 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Variables
PYTHON=python3
PYTHONFLAGS=-v
MAIN_PACKAGE=marketplace_reference_code.main
# Colors for terminal output
CYAN=\033[0;36m
NC=\033[0m # No Color
.PHONY: all clean lint fmt run deps help sync-deps
# Default target
all: lint fmt run
# Clean build artifacts
clean:
@printf "$(CYAN)Cleaning...$(NC)\n"
rm -rf build/
rm -rf dist/
rm -rf *.egg-info
find . -type f -name "*.pyc" -delete
find . -type d -name "__pycache__" -delete
find . -type d -name ".pytest_cache" -delete
find . -type d -name ".coverage" -delete
# Run linter
lint:
@printf "$(CYAN)Running linter...$(NC)\n"
$(PYTHON) -m flake8 marketplace_reference_code
$(PYTHON) -m mypy marketplace_reference_code
# Format code
fmt:
@printf "$(CYAN)Formatting code...$(NC)\n"
$(PYTHON) -m black marketplace_reference_code
$(PYTHON) -m isort marketplace_reference_code
# Run the application
run:
@printf "$(CYAN)Running $(MAIN_PACKAGE)...$(NC)\n"
$(PYTHON) -m $(MAIN_PACKAGE)
# Sync dependencies
sync-deps:
@printf "$(CYAN)Syncing dependencies...$(NC)\n"
$(PYTHON) -m pip install pip-tools
$(PYTHON) -m piptools compile --output-file=requirements.txt --strip-extras pyproject.toml
$(PYTHON) -m piptools compile --output-file=requirements-dev.txt pyproject.toml --extra=dev --extra=test
# Update deps target to use sync-deps
deps: sync-deps
@printf "$(CYAN)Installing dependencies...$(NC)\n"
$(PYTHON) -m pip install --upgrade pip
$(PYTHON) -m pip install -r requirements.txt
$(PYTHON) -m pip install -r requirements-dev.txt
# Show help
help:
@echo "Available targets:"
@echo " all - Install dependencies, clean, and build the project"
@echo " clean - Remove build artifacts"
@echo " lint - Run linter and type checker"
@echo " fmt - Format code with black and isort"
@echo " run - Run the application"
@echo " deps - Install dependencies"
@echo " help - Show this help message"