Blazing-fast C++/Python bindings with pybind11, optimized for Windows/macOS/Linux with zero configuration.
🚀 Key Upgrade: Now requires
uv>=0.7.20
for reproducible builds.
- One-command setup (
just setup
) with isolated environments - 3x faster builds with Ninja + compiler caching (auto-detects
sccache
/ccache
) - Cross-platform cleanup (
just clean
handles all OS artifacts) - Preconfigured CMake with pybind11/Python discovery
# Install latest uv (required >=0.7.20)
pip install --upgrade "uv>=0.7.20" just
OS | Command |
---|---|
Windows | choco install ninja cmake --params 'ADD_CMAKE_TO_PATH=System' |
macOS | brew install cmake ninja ccache |
Linux | sudo apt-get install cmake ninja-build ccache or use conda |
just setup # Creates venv, installs deps, configures CMake
just dev # Incremental build (watched by default)
just test # Run test.py
Command | Action |
---|---|
just setup |
Full environment setup (venv + CMake config) |
just dev |
Build + install extension incrementally (uses uv run for isolation) |
just check |
Validate module imports (hello_pybind11.hello_world() ) |
just clean |
Cross-platform cleanup (build dirs, .so/.pyd, caches) |
just rebuild |
Nuclear rebuild (clean + reinstall) |
💡 Pro Tip: Use
just -f Justfile --list
to see all commands.
just rebuild CMAKE_BUILD_TYPE=Debug # Debug symbols
just rebuild CMAKE_BUILD_TYPE=Release # Optimized (default)
# Windows (uses sccache automatically if installed)
just dev USE_SCCACHE=1
# macOS/Linux (uses ccache)
just dev USE_CCACHE=1
just setup python_version="3.12" # Override default 3.11.11
hello_pybind11/
├── CMakeLists.txt # Preconfigured for pybind11
├── main.cpp # Your bindings code
├── pyproject.toml # scikit-build-core config
├── Justfile # Cross-platform tasks (see below)
└── scripts/ # Build helpers
└── install_built_extensions.py # Handles .so/.pyd installation
# Force sccache (faster than ccache on Windows)
$env:USE_SCCACHE = "1"
just dev
# Use LLD for faster linking (Linux/macOS)
export CMAKE_ARGS="-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld"
just rebuild
# Build with verbose output
just dev --verbose
MIT — Free for all platforms.
- No OS-Specific Commands: The
Justfile
usesuv run
and Python scripts for all operations. - Artifact Handling:
just clean
removes.so
(Linux/macOS) and.pyd
(Windows) automatically. - uv Isolation: Every command runs in the project’s venv, avoiding system conflicts.
Confirmed with:
uv==0.7.20
- Windows (sccache), macOS (ccache), Linux (ccache)
- Python 3.11+