-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
143 lines (107 loc) · 5.88 KB
/
justfile
File metadata and controls
143 lines (107 loc) · 5.88 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
138
139
140
141
142
143
cpp_dir := "cpp"
py_dir := "python"
venv_bin := justfile_directory() / py_dir / ".venv" / "bin"
cmake_exe := venv_bin / "cmake"
# List available recipes
default:
@just --list
# ── Dependencies ──────────────────────────────────────────────────────────────
# Install all dependencies
install:
cd {{py_dir}} && uv sync
cd {{cpp_dir}} && vcpkg install
# ── C++ build ─────────────────────────────────────────────────────────────────
# Build the C++ library and pybind11 bindings (debug)
cpp-build-debug:
cd {{cpp_dir}} && "{{cmake_exe}}" --preset debug
cd {{cpp_dir}} && "{{cmake_exe}}" --build --preset debug
# Build the C++ library and pybind11 bindings (release)
cpp-build-release:
cd {{cpp_dir}} && "{{cmake_exe}}" --preset release
cd {{cpp_dir}} && "{{cmake_exe}}" --build --preset release
# ── Testing ───────────────────────────────────────────────────────────────────
# Run C++ unit tests (debug)
cpp-test-unit-debug: cpp-build-debug
{{cpp_dir}}/build/debug/lib/tests/unit/unit_tests
# Run C++ unit tests (release)
cpp-test-unit-release: cpp-build-release
{{cpp_dir}}/build/release/lib/tests/unit/unit_tests
# Run C++ integration tests (debug)
cpp-test-integration-debug: cpp-build-debug
{{cpp_dir}}/build/debug/lib/tests/integration/integration_tests
# Run C++ integration tests (release)
cpp-test-integration-release: cpp-build-release
{{cpp_dir}}/build/release/lib/tests/integration/integration_tests
# Run all C++ tests (debug)
cpp-test-debug: cpp-test-unit-debug cpp-test-integration-debug
# Run all C++ tests (release)
cpp-test-release: cpp-test-unit-release cpp-test-integration-release
# Run C++ tests with coverage report (output: cpp/coverage/html/)
cpp-test-coverage: cpp-test-unit-debug cpp-test-integration-debug
mkdir -p {{cpp_dir}}/coverage/html
cd {{cpp_dir}} && "{{venv_bin}}/gcovr" --root . --filter 'lib/src/' --filter 'lib/inc/' \
--exclude-unreachable-branches --exclude-throw-branches --decisions \
--html-template-dir gcovr_templates \
--print-summary --html-details coverage/html/index.html --txt \
--fail-under-line 100 --fail-under-branch 100 --fail-under-decision 100
# Run Python unit tests (debug)
py-test-unit-debug: cpp-build-debug
cd {{py_dir}} && uv run pytest tests/unit/ -v
# Run Python unit tests (release)
py-test-unit-release: cpp-build-release
cd {{py_dir}} && uv run pytest tests/unit/ -v
# Run Python integration tests (debug)
py-test-integration-debug: cpp-build-debug
cd {{py_dir}} && uv run pytest tests/integration/ -v
# Run Python integration tests (release)
py-test-integration-release: cpp-build-release
cd {{py_dir}} && uv run pytest tests/integration/ -v
# Run all Python tests (debug)
py-test-debug: py-test-unit-debug py-test-integration-debug
# Run all Python tests (release)
py-test-release: py-test-unit-release py-test-integration-release
# Run Python tests with coverage (output: python/coverage/html/)
py-test-coverage: cpp-build-release
cd {{py_dir}} && uv run pytest tests/unit/ tests/integration/ -v --cov=core_lib --cov-branch --cov-report=term-missing --cov-report=html:coverage/html --cov-fail-under=100
# ── Python package ───────────────────────────────────────────────────────────
# Build a distributable Python wheel
py-build-pkg:
cd {{py_dir}} && uv build --wheel
# ── Lint / Format ─────────────────────────────────────────────────────────────
# Format Python code and sort imports (ruff)
py-format:
cd {{py_dir}} && uv run ruff check --select I --fix src/ tests/
cd {{py_dir}} && uv run ruff format src/ tests/
# Check Python formatting and import order (ruff)
py-format-check:
cd {{py_dir}} && uv run ruff format --check src/ tests/
cd {{py_dir}} && uv run ruff check --select I src/ tests/
# Fix Python lint issues (ruff)
py-lint-fix:
cd {{py_dir}} && uv run ruff check --fix src/ tests/
# Check Python linting (ruff)
py-lint-check:
cd {{py_dir}} && uv run ruff check src/ tests/
# Run Python type checker (mypy)
py-typecheck:
cd {{py_dir}} && uv run mypy src/ tests/
# Format C++ code (clang-format)
cpp-format:
"{{venv_bin}}/clang-format" -i -style=file:{{cpp_dir}}/.clang-format \
$(find {{cpp_dir}} -name '*.cpp' -o -name '*.hpp' | grep -v build | grep -v vcpkg_installed)
# Check C++ formatting (clang-format)
cpp-format-check:
"{{venv_bin}}/clang-format" --dry-run --Werror -style=file:{{cpp_dir}}/.clang-format \
$(find {{cpp_dir}} -name '*.cpp' -o -name '*.hpp' | grep -v build | grep -v vcpkg_installed)
# ── Documentation ────────────────────────────────────────────────────────────
# Generate C++ API documentation (Doxygen + Sphinx/Breathe)
cpp-docs:
cd {{cpp_dir}} && doxygen docs/Doxyfile
cd {{cpp_dir}} && "{{venv_bin}}/sphinx-build" -b html docs docs/sphinx
# Generate Python documentation (Sphinx)
py-docs:
cd {{py_dir}} && uv run sphinx-build -b html docs docs/_build
# ── Clean ─────────────────────────────────────────────────────────────────────
# Remove all artifacts
clean:
git clean -Xdf