-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
104 lines (84 loc) · 2.28 KB
/
Copy pathMakefile
File metadata and controls
104 lines (84 loc) · 2.28 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
# Makefile for qodev-linkedin-api - Development tasks
# Prerequisites: uv (https://docs.astral.sh/uv/)
.PHONY: help
help:
@printf "\nLinkedIn Client Development Commands:\n\n"
@awk '/^#/{c=substr($$0,3);next}c&&/^[[:alpha:]][[:alnum:]_-]+:/{printf " \033[36m%-20s\033[0m %s\n", substr($$1,1,index($$1,":")-1),c}1{c=0}' $(MAKEFILE_LIST)
@printf "\nRun 'make install' to get started!\n\n"
###############
# Setup Tasks #
###############
.PHONY: install
# Install all dependencies (including dev)
install:
@command -v uv >/dev/null 2>&1 || { echo "uv is required. See https://docs.astral.sh/uv/"; exit 1; }
uv sync --all-extras
.PHONY: install-hooks
# Install pre-commit hooks
install-hooks:
@command -v uvx >/dev/null 2>&1 || { echo "uv is required."; exit 1; }
uvx pre-commit install
@echo "Pre-commit hooks installed!"
#############
# Testing #
#############
.PHONY: test
# Run tests with coverage
test:
uv run pytest --cov=linkedin --cov-report=term --cov-report=html
.PHONY: test-fast
# Run tests without coverage
test-fast:
uv run pytest
#####################
# Code Quality #
#####################
.PHONY: check
# Run all checks (lint, format, typecheck, typos)
check: lint format-check typecheck typos
.PHONY: lint
# Lint code with ruff
lint:
uv run ruff check src/ tests/
.PHONY: lint-fix
# Lint and auto-fix issues
lint-fix:
uv run ruff check --fix src/ tests/
.PHONY: format
# Format code with ruff
format:
uv run ruff format src/ tests/
.PHONY: format-check
# Check code formatting
format-check:
uv run ruff format --check src/ tests/
.PHONY: typecheck
# Run type checking with pyright
typecheck:
uv run pyright src/
.PHONY: typos
# Check for typos
typos:
@command -v uvx >/dev/null 2>&1 || { echo "uv is required."; exit 1; }
uvx typos
.PHONY: typos-fix
# Fix typos automatically
typos-fix:
@command -v uvx >/dev/null 2>&1 || { echo "uv is required."; exit 1; }
uvx typos --write-changes
################
# Build #
################
.PHONY: build
# Build package (sdist + wheel)
build:
uv build
##############
# Cleanup #
##############
.PHONY: clean
# Clean up generated files
clean:
rm -rf .pytest_cache .ruff_cache .mypy_cache .coverage htmlcov dist/
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete