Skip to content

Installation

hlock ships as a Python package with a compiled Rust core. Prebuilt wheels cover:

Platform Architectures
Linux (manylinux) x86_64, aarch64
macOS arm64 (Apple silicon), x86_64 (Intel)
Windows x64

One wheel per platform covers CPython 3.9 and newer (abi3). On other platforms, pip builds from the source distribution, which needs a Rust toolchain.

Install the CLI and Python package

pip install hlock
uv add hlock            # add to a project
uv tool install hlock   # or install the CLI globally
uvx hlock --help
pipx install hlock

Check that it worked:

$ hlock --version
hlock, version 0.1.2

harness-lock is an alias for hlock

harness-lock is published as an alias: each release pins the identical hlock release, so installing either name gives you the same hlock (and harness-lock) command and the same API. import hlock and import harness_lock are interchangeable. These docs use hlock everywhere.

Upgrading from 0.1.2 or earlier with pip

Through 0.1.2 the roles were reversed: harness-lock was the package and hlock the alias. Both the old harness-lock and the new hlock contain the harness_lock module, so pip install -U harness-lock in an existing 0.1.2 environment can leave harness_lock half removed (import hlock then fails with an ImportError). Reinstall cleanly instead:

pip uninstall -y harness-lock hlock && pip install hlock

uv upgrades in place without this problem.

Optional extras

Extra Install Adds
flyte pip install "hlock[flyte]" flyteplugins-rs, so the cluster backend can lift work to Flyte/Union tasks

The worker that runs heavy optimization stages (devbox and cluster backends) imports pandas/polars, torch/peft/trl, and flyte lazily, and only when a stage needs them. Install those in the worker's environment when you use the stages that need them; see Backends.

Use it from Rust

The core library is published on crates.io as hlock:

cargo add hlock

hlock (and its alias crate, harness-lock) re-export harness-lock-core. See the Rust API reference for an example and the key types.

Build from source

See Development.