Hammocking
Automatic mocking tool for C.
Installation
Install from PyPI:
pip install hammocking
Or with uv:
uv add hammocking
Hammocking depends on Jinja2 and libclang. They are installed automatically.
Development
DevPod / Dev Container (recommended)
The fastest way to get a working development environment is DevPod or any devcontainer-compatible tool (VS Code Dev Containers, GitHub Codespaces).
# Using DevPod CLI
devpod up https://github.com/avengineers/hammocking
# Or in VS Code: clone the repo, open it, and select "Reopen in Container"
The container comes with Python 3.13, uv, clang, llvm, cmake, and ninja-build.
Linux / macOS
Prerequisites
- Python 3.10 or higher (3.13 recommended)
- Git
Optional, for integration tests:
- clang / llvm
- cmake
- ninja-build
On Ubuntu/Debian:
sudo apt update
sudo apt install python3.13 python3.13-venv python3-pip git
# Optional: tools for integration tests
sudo apt install clang llvm cmake ninja-build
Build
./build.sh # full build (lint, test, docs)
./build.sh --clean # clean build
./build.sh --install # install dependencies only
Windows
Build
.\build.ps1 # full build (lint, test, docs)
.\build.ps1 -clean # clean build
.\build.ps1 -install # install dependencies only
Setting up the development environment manually
uv sync
uv run pre-commit install
Running tests
uv run pytest # all tests
uv run pytest -m unit # unit tests only
uv run pytest -m integration # integration tests only
If integration tests fail because clang is not installed, skip them:
uv run pytest -m "not integration"
What the build does
- Pre-commit checks and linting
- Running all tests
- Building documentation
Troubleshooting
uv not found
Make sure ~/.local/bin is on your PATH:
export PATH="$HOME/.local/bin:$PATH"
Add this line to your ~/.bashrc or ~/.zshrc to make it permanent.
Lock file errors
uv lock
uv sync
Links
- Documentation: https://hammocking.readthedocs.io
- PyPI: https://pypi.org/project/hammocking/
- Issues: https://github.com/avengineers/hammocking/issues
Metadata
Release files for hammocking 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hammocking-1.0.2.tar.gz | 406.7 kB | Without provenance | Details for hammocking-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hammocking-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for hammocking-1.0.2-py3-none-any.whl |
Total release size: 419.3 kB
Release files / hammocking-1.0.2.tar.gz
| Download URL | hammocking-1.0.2.tar.gz |
|---|---|
| Size | 406.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
309a3fff0a1c4461390128c82abe7881599f018ba6be828b1cbc51860fe60f47
|
|
BLAKE2b-256 checksum How to use checksums |
fd0eb0c0ee876af8ad404c3c1e277d24da9bc9c82e747a93ea31283afe8a5825
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / hammocking-1.0.2-py3-none-any.whl
| Download URL | hammocking-1.0.2-py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7fa0124b268b8941794a83427a0aa9d3001c75a9f3b458ab03316d07febec7a9
|
|
BLAKE2b-256 checksum How to use checksums |
968670140c041f2e4210054e81bf26afca6dffe4527f8a7d915aa5da1769bf62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Security for hammocking 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.