benfred/py-spy
60.4
Adequate · 14 November 2026
89.9k
lines of production code
Rust
primary language
5
measurements over time
What this system is
Features
Add Chrome Trace format for recording samples
Users can now record profiling data in the Chrome Trace format (chrome://tracing) by specifying the chrometrace output format. This is implemented in src/chrometrace.rs, which generates trace events with start/end phases for stack frames, and is exposed as a new FileFormat variant in src/config.rs.
src · high confidence
Add example for dumping Python stack traces
A new example file, examples/dump\_traces.rs, demonstrates how to use the Rust API to retrieve and print stack traces from a running Python process. The example initializes a PythonSpy instance with default configuration, retrieves stack traces for all threads in the specified process ID, and prints the thread IDs, statuses, and frame details (name, filename, line number) to the console.
examples · high confidence
Introduce pre-commit hooks for automated linting
The project now uses pre-commit hooks to automatically enforce code quality standards before commits. This configuration integrates codespell for checking spelling in Python and TOML files, Rust formatting and cargo checks, and Prettier for YAML files, ensuring consistent code style across the repository.
(repo-wide) · high confidence
Removals
Removal of Python bindings module declarations
The Rust source file for the Python bindings has been deleted, removing the module declarations for versions 2.7.15, 3.3.7, 3.5.5, 3.6.6, and 3.7.0. This change eliminates the Python binding interface for these specific versions from the codebase.
python-bindings · high confidence
Removed vendored flamegraph.pl library
The project has removed the vendored \flamegraph.pl\ library and its associated CDDL license text from the \vendor/flamegraph\ directory. This change eliminates the local copy of Brendan Gregg's flame graph generation tool, meaning users can no longer rely on this specific vendored script for rendering flamegraphs within the project.
vendor · high confidence
Behavioural changes
Automated Python version matrix updates and new FreeBSD CI infrastructure
The CI pipeline now automatically updates the GitHub Actions test matrix to include the latest supported Python versions by fetching data from the GitHub python-versions manifest, ensuring coverage of new releases without manual intervention. Additionally, new scripts and configuration files have been added to support FreeBSD builds, including a Vagrantfile for local development, a test script for building and caching artifacts, and a publish script to upload FreeBSD release tarballs to GitHub Releases.
ci · high confidence
Expanded Python version support and cross-platform GIL detection
The Python bindings module now includes generated bindings for Python versions 3.10, 3.11, 3.12, 3.13, and 3.14, extending the previously supported range. To ensure accurate thread state and Global Interpreter Lock (GIL) detection across these versions, the module introduces version- and architecture-specific offset calculations for the \interp\_head\ and \tstate\_current\ members of the \PyRuntime\ structure, covering platforms such as macOS, Linux (x86, ARM, aarch64, x86\_64), and Windows. Additionally, the bindings directory has been reorganized into a submodule, and existing bindings have been updated to use modern Clippy lint allowances.
_src/python\bindings · high confidence
Test coverage
Added Cython test data for native extension profiling; Added integration test scripts for subprocesses, threads, and local variables; Added integration tests for py-spy profiling capabilities.
Dependencies
py-spy 0.4.2 dependency overhaul and CLI feature gating
The py-spy project has been updated to version 0.4.2, introducing a comprehensive dependency upgrade and structural change. The CLI interface is now gated behind an optional \cli\ feature flag, allowing the core library to be used without pulling in command-line dependencies like \clap\, \console\, and \inferno\. Key library dependencies have been significantly upgraded, including \clap\ to 4.6.1, \remoteprocess\ to 0.5.2, \goblin\ to 0.10.5, and \console\ to 0.16. The build system has also migrated to \maturin\ (\>=1.0) for Python bindings, replacing the previous \python-bindings\ crate structure.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 62 → 60 (-2.0)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 89 → 99 (+9.7)
- Architecture 90 → 99 (+8.6)
- Maturity 53 → 53 (+0.4)
- Readiness 63 → 62 (-1.7)
- Security 68 → 54 (-13.9)
Resolved (85)
- Config::from_args (cognitive 25) (src/config.rs)
- Config::from_args (cyclomatic 25) (src/config.rs)
- ConsoleViewer::display (cognitive 26) (src/console_viewer.rs)
- ConsoleViewer::display (cyclomatic 24) (src/console_viewer.rs)
- ConsoleViewer::increment (cognitive 16) (src/console_viewer.rs)
- DictIterator::from_managed_dict (cognitive 16) (src/python_data_access.rs)
- DictIterator::next (cognitive 16) (src/python_data_access.rs)
- Duplicated block (10 lines × 5) (src/python_bindings/v3_3_7.rs)
- Duplicated block (11 lines × 3) (src/python_bindings/v3_10_0.rs)
- Duplicated block (11 lines × 48) (src/python_bindings/v3_11_0.rs)
- Duplicated block (11 lines × 5) (src/python_bindings/v3_11_0.rs)
- Duplicated block (11 lines × 8) (src/python_bindings/v3_10_0.rs)
- Duplicated block (12 lines × 2) (src/python_bindings/v3_13_0.rs)
- Duplicated block (13 lines × 5) (src/python_bindings/v3_11_0.rs)
- Duplicated block (13 lines × 5) (src/python_bindings/v3_11_0.rs)
- Duplicated block (13 lines × 8) (src/python_bindings/v3_10_0.rs)
- Duplicated block (14 lines × 3) (src/python_bindings/v3_10_0.rs)
- Duplicated block (14 lines × 5) (src/python_bindings/v3_3_7.rs)
- Duplicated block (15 lines × 2) (src/binary_parser.rs)
- Duplicated block (15 lines × 2) (src/python_bindings/mod.rs)
- …and 65 more
New (37)
- Duplicated block (14 lines × 2) (src/python_data_access.rs)
- Duplicated block (15 lines × 2) (src/binary_parser.rs)
- Duplicated block (15 lines × 2) (src/python_bindings/mod.rs)
- Duplicated block (17–18 lines × 4) (src/python_bindings/mod.rs)
- Duplicated block (28–29 lines × 2) (src/python_process_info.rs)
- Duplicated block (8–11 lines × 2) (src/sampler.rs)
- Edited copy of a member (16 corresponding lines) (src/python_process_info.rs)
- Low coverage: src/binary_parser.rs (src/binary_parser.rs)
- Low coverage: src/chrometrace.rs (src/chrometrace.rs)
- Low coverage: src/console_viewer.rs (src/console_viewer.rs)
- Low coverage: src/coredump.rs (src/coredump.rs)
- Low coverage: src/dump.rs (src/dump.rs)
- Low coverage: src/flamegraph.rs (src/flamegraph.rs)
- Low coverage: src/lib.rs (src/lib.rs)
- Low coverage: src/main.rs (src/main.rs)
- Low coverage: src/python_bindings/mod.rs (src/python_bindings/mod.rs)
- Low coverage: src/python_bindings/v2_7_15.rs (src/python_bindings/v2_7_15.rs)
- Low coverage: src/python_bindings/v3_10_0.rs (src/python_bindings/v3_10_0.rs)
- Low coverage: src/python_bindings/v3_11_0.rs (src/python_bindings/v3_11_0.rs)
- Low coverage: src/python_bindings/v3_12_0.rs (src/python_bindings/v3_12_0.rs)
- …and 17 more
Changes since last survey
- 5 commits — 5 feature/other, 0 fixes
By area
- .github/workflows — 2 commits
- (root) — 1 commit
- src/config.rs — 1 commit
- src/coredump.rs — 1 commit
Notable commits
- change: Add optional type checks for code, string and dict objects (#885)
- change: Bump version: 0.4.2 → 0.4.3
- change: Refactor interpreter macros (#904)
- change: Update GHA to use python 3.14 by default (#901)
- change: Update tested python versions (#896)
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
benfred/py-spy was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 14 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit c53bfe136535cb525a35ded61e9afac35754e522 — the exact code this score is about.
- Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-e1a3b69fc8ee.