Skip to main content

puncover

Analyzes C/C++ binaries for code size, static variables and stack usages. It creates a report with disassembler and call-stack analysis per directory, file, or function.

Installation and Usage

Install with pip:

pip install puncover

Run it by passing the binary to analyze:

puncover project.elf
...
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

Open the link in your browser to view the analysis.

You can also use uvx to run the script without installing globally:

uvx puncover project.elf

Report export and non-interactive usage

To monitor firmware changes in CI it can be useful to run puncover and save a JSON report.

To generate a report add these flags --generate-report --non-interactive --report-type json and for a distinguishing entry to save more than one report in one file also add a report tag --report-tag $COMMIT_FEATURE. The report is saved under this tag as an object entry.

Running Tests Locally

Setup

To run the tests locally, you need to install the development dependencies. This project uses uv to manage the python environment.

uv venv && source .venv/bin/activate
uv sync

Running Tests

Then you can run the tests with tox (note that this will fail if any of the supported python versions aren't found, see tox.ini):

tox

or, to target only the current python on $PATH:

tox -e py

Publishing Release

Release Script

See release.sh for a script that automates the above steps. Requires uv to be installed. This example will work with the PyPi tokens (now required):

PUNCOVER_VERSION=0.3.5 PYPI_TOKEN=<pypi token> ./release.sh

Manual Steps

Only for reference, the release script should take care of all of this.

Click to expand
  1. Update the version in puncover/__version__.py.

  2. Commit the version update:

    git add . && git commit -m "Bump version to x.y.z"
    
  3. Create an annotated tag:

    git tag -a {-m=,}x.y.z
    
  4. Push the commit and tag:

    git push && git push --tags
    
  5. Either wait for the GitHub Action to complete and download the release artifact for uploading: https://github.com/HBehrens/puncover/actions OR Build the package locally: python setup.py sdist bdist_wheel

  6. Upload the package to PyPI:

    twine upload dist/*
    
  7. Create GitHub releases:

    • gh release create --generate-notes x.y.z
    • attach the artifacts to the release too: gh release upload x.y.z dist/*

Contributing

Contributions are welcome! Please open an issue or pull request on GitHub.

Metadata

Release files for puncover 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for puncover 0.8.0
File Size Uploaded
puncover-0.8.0.tar.gz 173.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for puncover 0.8.0
File Interpreter ABI Platform
puncover-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 348.6 kB

Release files / puncover-0.8.0.tar.gz

Download URL puncover-0.8.0.tar.gz
Size 173.1 kB
Tags Source
SHA-256 checksum
How to use checksums
df0b9251f26a4bfade9721c5f1c48194b4b5f3620fadac5e0a2c044c72c74a38
BLAKE2b-256 checksum
How to use checksums
3ab45a043c45c418afc46d1fbdaaca55634d29ae14e9a3e50da2f7f84db8e2e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / puncover-0.8.0-py3-none-any.whl

Download URL puncover-0.8.0-py3-none-any.whl
Size 175.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b848bef54a88bdd3a5cf53627c0451f28bb62bb2c0fa289ecf797a62a516f6c
BLAKE2b-256 checksum
How to use checksums
348aa0b3485daa4a25a9354165c0b2ca3da257bb8ed5bcc9e534942afae5dbfb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page