Automatic mocking tool for C.
Install from PyPI:
pip install hammockingOr with uv:
uv add hammockingHammocking depends on Jinja2 and libclang. They are installed automatically.
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.
- 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.sh # full build (lint, test, docs)
./build.sh --clean # clean build
./build.sh --install # install dependencies only.\build.ps1 # full build (lint, test, docs)
.\build.ps1 -clean # clean build
.\build.ps1 -install # install dependencies onlyuv sync
uv run pre-commit installuv run pytest # all tests
uv run pytest -m unit # unit tests only
uv run pytest -m integration # integration tests onlyIf integration tests fail because clang is not installed, skip them:
uv run pytest -m "not integration"- Pre-commit checks and linting
- Running all tests
- Building documentation
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.
uv lock
uv sync- Documentation: https://hammocking.readthedocs.io
- PyPI: https://pypi.org/project/hammocking/
- Issues: https://github.com/avengineers/hammocking/issues