forked from CaptainIgl00/resume
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
137 lines (108 loc) Β· 4.42 KB
/
Copy pathMakefile
File metadata and controls
137 lines (108 loc) Β· 4.42 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# Modern Python-based Makefile for resume-ats
.PHONY: help install install-dev build test validate clean setup lint format type-check docs
# Default Python and package manager
PYTHON ?= python3
PIP ?= pip
PACKAGE = resume-ats
# Colors for output
CYAN = \033[0;36m
GREEN = \033[0;32m
YELLOW = \033[0;33m
RED = \033[0;31m
NC = \033[0m # No Color
help: ## Show this help message
@echo "$(CYAN)Available commands:$(NC)"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " $(GREEN)%-15s$(NC) %s\n", $$1, $$2}'
install: ## Install package in development mode
@echo "$(CYAN)π¦ Installing package in development mode...$(NC)"
$(PIP) install -e .
install-dev: ## Install with development dependencies
@echo "$(CYAN)π§ Installing development dependencies...$(NC)"
$(PIP) install -e ".[dev,test,ats]"
install-ats: ## Install ATS dependencies only
@echo "$(CYAN)π€ Installing ATS dependencies...$(NC)"
$(PIP) install -e ".[ats]"
setup: install-ats ## Setup ATS dependencies (NLTK, spaCy)
@echo "$(CYAN)βοΈ Setting up ATS dependencies...$(NC)"
$(PYTHON) -m resume_ats.cli setup
# Building
build: ## Build resume (PDF by default)
@echo "$(CYAN)ποΈ Building resume...$(NC)"
@mkdir -p build
@cp *.png build/ 2>/dev/null || true
$(PYTHON) -m resume_ats.cli build
build-all: ## Build all formats (PDF, HTML, JSON)
@echo "$(CYAN)π Building all formats...$(NC)"
$(PYTHON) -m resume_ats.cli build --format pdf --format html --format json
# Testing and validation
test: ## Run all tests
@echo "$(CYAN)π§ͺ Running tests...$(NC)"
pytest
test-verbose: ## Run tests with verbose output
@echo "$(CYAN)π Running tests (verbose)...$(NC)"
pytest -v -s
test-ats: ## Run ATS compatibility tests only
@echo "$(CYAN)π€ Running ATS tests...$(NC)"
pytest -m ats -v
validate: ## Validate generated PDF against YAML
@echo "$(CYAN)β
Validating ATS compatibility...$(NC)"
$(PYTHON) -m resume_ats.cli validate resume.yml build/MathΓ©o_Guilloux_CV.pdf
extract: ## Extract data from generated PDF
@echo "$(CYAN)π Extracting PDF data...$(NC)"
$(PYTHON) -m resume_ats.cli extract build/MathΓ©o_Guilloux_CV.pdf
# Development tools
lint: ## Run linting (ruff)
@echo "$(CYAN)π Running linter...$(NC)"
ruff check src/ tests/
format: ## Format code (black + ruff)
@echo "$(CYAN)π¨ Formatting code...$(NC)"
black src/ tests/
ruff check --fix src/ tests/
type-check: ## Run type checking (mypy)
@echo "$(CYAN)π Type checking...$(NC)"
mypy src/resume_ats/
# Quality checks
check: lint type-check test ## Run all quality checks
# Utility
clean: ## Clean build artifacts
@echo "$(CYAN)π§Ή Cleaning build artifacts...$(NC)"
rm -rf build/ dist/ *.egg-info/ .pytest_cache/ .coverage htmlcov/
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete
clean-all: clean ## Clean everything including venv
@echo "$(CYAN)ποΈ Cleaning everything...$(NC)"
rm -rf .venv/
# Watch for changes (requires entr)
watch: ## Auto-rebuild on file changes
@echo "$(CYAN)π Watching for changes...$(NC)"
find . -name '*.yml' -o -name '*.yaml' -o -name '*.j2' | entr -c make build
# Docker support (optional)
docker-build: ## Build Docker image
@echo "$(CYAN)π³ Building Docker image...$(NC)"
docker build -t $(PACKAGE) .
docker-run: ## Run in Docker container
@echo "$(CYAN)π³ Running in Docker...$(NC)"
docker run --rm -v $(PWD):/workspace $(PACKAGE)
# Package management
dist: ## Build distribution packages
@echo "$(CYAN)π¦ Building distribution...$(NC)"
$(PYTHON) -m build
publish-test: dist ## Publish to test PyPI
@echo "$(CYAN)π Publishing to test PyPI...$(NC)"
twine upload --repository testpypi dist/*
publish: dist ## Publish to PyPI
@echo "$(CYAN)π Publishing to PyPI...$(NC)"
twine upload dist/*
# Legacy compatibility
pdf: build ## Legacy: build PDF (alias for build)
html: ## Legacy: build HTML
$(PYTHON) -m resume_ats.cli build --format html
# Show current status
status: ## Show project status
@echo "$(CYAN)π Project Status:$(NC)"
@echo " Package: $(PACKAGE)"
@echo " Python: $(shell $(PYTHON) --version)"
@echo " Virtual env: $(VIRTUAL_ENV)"
@if [ -f "resume.yml" ]; then echo " β
resume.yml found"; else echo " β resume.yml missing"; fi
@if [ -d "templates" ]; then echo " β
templates/ found"; else echo " β templates/ missing"; fi
@if [ -d "build" ]; then echo " β
build/ exists"; else echo " βΉοΈ build/ will be created"; fi