Skip to content

Commit 2f164ec

Browse files
berisherclaude
andcommitted
fix: exclude python-bindings from coverage build
The Code Coverage job (cargo tarpaulin, nightly toolchain) was failing to link with: rust-lld: error: undefined symbol: _PyEval_RequestCodeExtraIndex referenced by pyo3_ffi::cpython::ceval tarpaulin.toml set `all-features = true`, which enables the optional `python-bindings` feature and compiles src/python.rs into the coverage test binary, link-binding libpython. Under the nightly toolchain's rust-lld (now the default linker) the private CPython symbol does not resolve, so the binary fails to link. This is deterministic, not a flake — re-running the job reproduces it. The bindings are a thin PyO3 FFI shim that cannot be exercised from Rust tests (they need a live interpreter), so src/python.rs always scored 0/36 lines and contributed nothing measurable. The real Python surface is covered by the maturin-built pytest suite. Set `all-features = false` so coverage builds the default feature set. This drops the unlinkable FFI shim from the build graph and, by removing 36 uncoverable lines from the denominator, nudges reported coverage up (80.85% -> 81.71% locally) rather than down. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent ff4a2d3 commit 2f164ec

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

tarpaulin.toml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,15 @@ exclude-files = [
2626
"benches/*",
2727
]
2828

29-
# Run tests with all features
30-
all-features = true
29+
# Coverage measures the Rust library and CLI under the default feature
30+
# set. The optional `python-bindings` feature is deliberately excluded:
31+
# src/python.rs is a thin PyO3 FFI shim that cannot be exercised from
32+
# Rust tests (it needs a live interpreter, so it always scored 0/36), and
33+
# building it links libpython into the coverage test binary, which fails
34+
# to link under the nightly toolchain's rust-lld (undefined symbol
35+
# _PyEval_RequestCodeExtraIndex). The Python surface is covered by the
36+
# maturin-built pytest suite instead.
37+
all-features = false
3138

3239
# Timeout duration for tests to finish
3340
test-timeout = "2m"

0 commit comments

Comments
 (0)