-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmise.toml
More file actions
111 lines (91 loc) · 3.45 KB
/
Copy pathmise.toml
File metadata and controls
111 lines (91 loc) · 3.45 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
[tools]
python = ["3.14", "3.13", "3.12"]
ruff = "latest"
uv = "latest"
rust = { version = "latest", profile = "default", components = "llvm-tools-preview" }
"aqua:tombi-toml/tombi" = "latest"
"github:taiki-e/cargo-llvm-cov" = "latest"
[tasks.python_lint]
description = "Run Python linting with ruff"
run = [
"ruff check --fix .",
"ruff format .",
]
[tasks.rust_lint]
description = "Run Rust linting with clippy and rustfmt"
run = [
"cargo fmt",
"cargo clippy --fix --allow-dirty --allow-staged --all-targets --all-features -- -D warnings",
]
[tasks.toml_lint]
description = "Run toml formatting with tombi"
run = "tombi format"
[tasks.lint]
description = "Run all linting tasks"
depends = ["python_lint", "rust_lint", "toml_lint"]
[tasks.test_py312]
description = "Run pytest with Python 3.12"
tools.python = "3.12"
usage = 'arg "[files]" var=#true help="Files to test"'
run = "uv run --python 3.12 --group test pytest -- ${usage_files}"
[tasks.test_py313]
description = "Run pytest with Python 3.13"
tools.python = "3.13"
usage = 'arg "[files]" var=#true help="Files to test"'
run = "uv run --python 3.13 --group test pytest -- ${usage_files}"
[tasks.test_py314]
description = "Run pytest with Python 3.14"
tools.python = "3.14"
alias = "test"
usage = 'arg "[files]" var=#true help="Files to test"'
run = "uv run --python 3.14 --group test pytest -- ${usage_files}"
[tasks.test_all_versions]
description = "Run tests on all Python versions (3.12, 3.13, 3.14)"
usage = 'arg "[files]" var=#true help="Files to test"'
run = [
"mise run test_py312 ${usage_files}",
"mise run test_py313 ${usage_files}",
"mise run test_py314 ${usage_files}"
]
[tasks.build]
description = "Builds the project (in development mode)"
run = "uv build"
[tasks.clean]
description = "Clean build artifacts and caches"
run = [
"rm -rf *.so src/covers/*.so || true",
"rm -rf src/*.egg-info || true",
"rm -rf build dist target || true",
"find . -iname __pycache__ -exec rm -r '{}' \\+ || true",
"rm -rf .pytest_cache || true",
]
[tasks.benchmark]
description = "Run benchmarks"
run = [
"uv run --config-setting 'build-args=--profile=release' --group benchmark -- python benchmarks/benchmarks.py run",
]
[tasks.plot]
description = "Generate benchmark plots"
run = [
"uv run --group benchmark -- python benchmarks/benchmarks.py plot --os=Linux --python=3.14.0 --out benchmarks/cpython.png --speedup --title \"Covers Coverage Speedup on CPython (higher is better)\" --bar-labels --edit-readme \"CPython-range\"",
]
[tasks.coverage]
description = "Run code coverage for Python and Rust"
run = '''
# Clean up old coverage files
rm -f coverage_py.lcov coverage_rust.lcov coverage.lcov
# Set up environment variables for Rust instrumentation coverage
eval "$(cargo llvm-cov show-env --export-prefix 2>/dev/null | grep '^export')"
# Clean previous profiling data
cargo llvm-cov clean --workspace
# Run Rust tests with coverage instrumentation
cargo test
# Run Python tests with Python coverage (this will also exercise Rust code)
uv run --group test -- maturin develop --uv
uv run --group test -- covers --lcov --out coverage_py.lcov -m pytest
# Generate Rust coverage report from all profraw files (includes coverage from Python tests)
cargo llvm-cov report --lcov --output-path coverage_rust.lcov
# Combine coverage files
cat coverage_py.lcov coverage_rust.lcov > coverage.lcov
echo 'Coverage generated: coverage_py.lcov (Python), coverage_rust.lcov (Rust), coverage.lcov (combined)'
'''