Repository navigation
refactor: split lib.rs, add rustdoc and enforce 90% coverage - #3
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split the extension into api, config, checker, worker and stream modules; lib.rs now only registers the existing Python API. Document module responsibilities and functions, and validate rustdoc with warnings denied. Preserve proxy handling, timeouts, concurrency and body-read semantics.
Expand testing to 11 Rust tests and 8 Python API/integration tests. Cover malformed/unsupported proxies, HTTP 200/503 and both body modes, truncated bodies, transport failures, optional result fields and elapsed saturation, queue item/error/end messages and malformed messages, event-loop failures, worker initialization errors, empty streams and bounded concurrency. All network tests use local servers.
Add the CI check Coverage (>=90%). scripts/coverage.sh uses LLVM instrumentation across Rust unit tests and Python tests against the built wheel, then enforces --fail-under-lines 90. No production module is excluded; test files and dependencies are excluded. The job summary includes a progress bar, and rust-coverage artifacts include measured SVG/JSON/HTML reports. Move the PyO3 extension-module feature to Maturin so Rust tests can embed Python while wheels retain extension-module mode.
Validation: cargo clippy --locked --all-targets -- -D warnings, formatting/diff checks, rustdoc with -D warnings, 11 Rust tests, 8 Python tests, and the complete coverage script passed locally on CPython 3.12. Production Rust line coverage: 98.15% (319/325 lines); region coverage 93.35%. This threshold covers lines, not branch coverage. CI also retains Python 3.10/3.15 API jobs.