Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
103 lines (78 loc) · 3.2 KB
/
Copy pathMakefile
File metadata and controls
103 lines (78 loc) · 3.2 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
.PHONY: help install install-dev lint format type-check test test-cov docs-install docs-serve docs-build screenshots pre-commit-install pre-commit-run
export NO_MKDOCS_2_WARNING := 1
UV := uv
# =======================================================================
# Help
# =======================================================================
help:
@echo "Development:"
@echo " make install Install production dependencies"
@echo " make install-dev Install all dev dependencies"
@echo ""
@echo "Tests:"
@echo " make test Execute tests using pytest"
@echo " make test-cov Run pytest with coverage reporting"
@echo ""
@echo "Documentation:"
@echo " make docs-install Install documentation dependencies"
@echo " make docs-serve Serve documentation locally"
@echo " make docs-build Build documentation with mkdocs"
@echo " make screenshots Generate screenshots and showcase GIF"
@echo ""
@echo "Quality:"
@echo " make lint Check code style using ruff"
@echo " make format Format code using ruff"
@echo " make type-check Check types using pyright"
@echo ""
# ---------------------------------------------------------------------------
# Setup
# ---------------------------------------------------------------------------
install:
$(UV) sync --all-packages --no-dev
install-dev:
$(UV) sync --all-packages
sync:
$(UV) sync --all-packages
pre-commit-install:
$(UV) run pre-commit install --hook-type pre-commit --hook-type commit-msg
pre-commit-run:
$(UV) run pre-commit run --all-files
# ---------------------------------------------------------------------------
# Quality
# ---------------------------------------------------------------------------
lint:
$(UV) run ruff check .
format:
$(UV) run ruff format .
$(UV) run ruff check --fix .
type-check:
$(UV) run pyright
type-check-json:
$(UV) run pyright --outputjson
# ---------------------------------------------------------------------------
# Tests
# ---------------------------------------------------------------------------
test:
$(UV) run pytest
test-cov:
$(UV) run pytest --cov=qtframelesskit --cov-report=term-missing --cov-report=html
# ---------------------------------------------------------------------------
# Documentation
# ---------------------------------------------------------------------------
docs-install:
$(UV) sync --extra docs
docs-serve:
$(UV) run mkdocs serve
docs-build:
$(UV) run mkdocs build --clean
screenshots:
$(UV) run python scripts/generate_screenshots.py
screenshots-win11:
$(UV) run python scripts/generate_screenshots.py --os win11
screenshots-win10:
$(UV) run python scripts/generate_screenshots.py --os win10
# ---------------------------------------------------------------------------
# Cleanup
# ---------------------------------------------------------------------------
clean:
$(UV) run python -c "import shutil, pathlib; [shutil.rmtree(p, ignore_errors=True) for p in ['dist','site','htmlcov','.pytest_cache','.ruff_cache']]; [shutil.rmtree(p, ignore_errors=True) for p in pathlib.Path('.').rglob('__pycache__')]; [shutil.rmtree(p, ignore_errors=True) for p in pathlib.Path('.').rglob('*.egg-info')]"