Skip to main content

rulebearing

One architecture rule set for TypeScript, .NET and Python: deterministic guardrails an agent can check its own changes against. This package puts the rulebearing binary on a Python project's path. Source, documentation and releases: https://github.com/benbahrenburg/rulebearing

pip install rulebearing
rulebearing --version
rulebearing cruise --config rulebearing.yaml -T err src

The command-line surface is the binary's (rulebearing --help); the exit codes are those of ADR-0008. To run each rule as a pytest test, install pytest-rulebearing.

How the package works

The package is a launcher and nothing else (architecture § Distribution, FR-DIST-01, Wave 2, Step 14). There is one wheel per release target, each carrying that target's binary at rulebearing/bin/rulebearing (.exe on Windows), so pip installs the one that matches the machine. There is no source distribution: a build from source is cargo build --release -p rb-cli.

Wheel platform tag Release target Installed on
manylinux_2_N_x86_64 x86_64-unknown-linux-gnu Linux x64 with glibc 2.N or newer, N read from the binary
manylinux_2_N_aarch64 aarch64-unknown-linux-gnu Linux arm64 with glibc 2.N or newer
musllinux_1_1_x86_64 x86_64-unknown-linux-musl (static) Linux x64 with musl (Alpine)
macosx_11_0_arm64 aarch64-apple-darwin macOS 11 or newer, arm64
macosx_10_12_x86_64 x86_64-apple-darwin macOS 10.12 or newer, x64
win_amd64 x86_64-pc-windows-msvc Windows x64

The console script rulebearing (and python -m rulebearing) runs the binary with every argument unchanged. On Linux and macOS the launcher process becomes the binary, so its exit code and signals are the binary's; on Windows it waits and returns the binary's exit code. It never re-implements a subcommand.

Environment variable Effect
RULEBEARING_BINARY Path to a rulebearing binary to run instead of the bundled one. A path that does not exist is exit 2 with one line naming it.

Building a wheel

hatch_build.py is the hatchling hook that stamps the release version and bundles the binary; the environment says which:

Variable Meaning
RULEBEARING_WHEEL_BINARY the binary to bundle; required, since a wheel without one would install a command that cannot run
RULEBEARING_WHEEL_TARGET the Rust target triple of that binary; default the host's
RULEBEARING_WHEEL_GLIBC for a *-linux-gnu target, the newest glibc symbol version the binary needs (2.34), which names the manylinux tag; default the host's glibc
RULEBEARING_VERSION the version; default the [workspace.package] version of the root Cargo.toml. A semantic pre-release (0.2.0-rc.1) is written as PEP 440 (0.2.0rc1)
cargo build --release -p rb-cli
pip install build hatchling packaging
RULEBEARING_WHEEL_BINARY=target/release/rulebearing python -m build --wheel --no-isolation wrappers/pip

The release workflow builds the six wheels from the release archives and publishes them (docs/release.md).

Developing this package

Linted and type-checked by the root configuration through cargo xtask lint (ADR-0023); the tests hold the 70% line floor of ADR-0018. tests/test_wheel_smoke.py builds a wheel with the locally built binary, installs it into a new virtual environment and runs rulebearing --version.

pytest wrappers/pip --cov=wrappers/pip        # from the repository root; needs target/release/rulebearing

Metadata

Release files for rulebearing 0.1.3

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

Built distributions (wheels)

Table of built distributions (wheels) for rulebearing 0.1.3
File
rulebearing-0.1.3-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
rulebearing-0.1.3-py3-none-musllinux_1_1_x86_64.whl Python 3 none Linux musl 1.1+ x86-64 Details
rulebearing-0.1.3-py3-none-manylinux_2_39_x86_64.whl Python 3 none Linux glibc 2.39+ x86-64 Details
rulebearing-0.1.3-py3-none-manylinux_2_39_aarch64.whl Python 3 none Linux glibc 2.39+ ARM64 Details
rulebearing-0.1.3-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
rulebearing-0.1.3-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details

Total release size: 55.8 MB

Release files / rulebearing-0.1.3-py3-none-win_amd64.whl

Download URL rulebearing-0.1.3-py3-none-win_amd64.whl
Size 9.9 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
ecdf685203fb52ba6f1f3d9655459d0b6bd18c83b6e9b03a4a4acea852b672db
BLAKE2b-256 checksum
How to use checksums
a5d2955aeb6c898058716790dc898ccdda101fc5cc9014467f2fcbefa1d09375
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / rulebearing-0.1.3-py3-none-musllinux_1_1_x86_64.whl

Download URL rulebearing-0.1.3-py3-none-musllinux_1_1_x86_64.whl
Size 9.7 MB
Tags Linux musl 1.1+ x86-64 Python 3
SHA-256 checksum
How to use checksums
74ca160f9937d5ef0ecfb8531940b491ef239d7b2296ab1770cfdad5893c9939
BLAKE2b-256 checksum
How to use checksums
20864f155916cb9cc3b923c969f07d34d3b59666cbb51d4e7a8e8560ecc83397
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / rulebearing-0.1.3-py3-none-manylinux_2_39_x86_64.whl

Download URL rulebearing-0.1.3-py3-none-manylinux_2_39_x86_64.whl
Size 9.5 MB
Tags Linux glibc 2.39+ x86-64 Python 3
SHA-256 checksum
How to use checksums
f320017d81be88f1309bb176121ba1e7ae76de93e9ebb4158772030d41d2805d
BLAKE2b-256 checksum
How to use checksums
dd5f3ae1987bff8e0e3d23465d2e34cb8a952280aff6195e2c441893df37313b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / rulebearing-0.1.3-py3-none-manylinux_2_39_aarch64.whl

Download URL rulebearing-0.1.3-py3-none-manylinux_2_39_aarch64.whl
Size 8.8 MB
Tags Linux glibc 2.39+ ARM64 Python 3
SHA-256 checksum
How to use checksums
21a4ae1bee8050ad8d54f7aa54610c02b994fe0e936a0d93f566e9adea74643f
BLAKE2b-256 checksum
How to use checksums
35566b3fd637bd79ce49f09324b039a2959ac77cc3a8b6f7303403e198a1f4ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / rulebearing-0.1.3-py3-none-macosx_11_0_arm64.whl

Download URL rulebearing-0.1.3-py3-none-macosx_11_0_arm64.whl
Size 8.6 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a75e160fd790e76f38ce034b46af3f19174443c70eb91fcbee42cde14f7a5a7e
BLAKE2b-256 checksum
How to use checksums
b2363ae296be83884c7e314234314887ce085b8e5179b5293388f0ec017a8dd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / rulebearing-0.1.3-py3-none-macosx_10_12_x86_64.whl

Download URL rulebearing-0.1.3-py3-none-macosx_10_12_x86_64.whl
Size 9.3 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ef19d8bd4da0aa5e9f2a4bcd98a1194ebee09273a021e917820e2d705ff41e56
BLAKE2b-256 checksum
How to use checksums
e2e5a435d53f5246b0fc3810cb683f0e531b77e5db618263719d29f11fd3e952
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release history Release notifications | RSS feed

This release

0.1.3 This release

6 release files

0.1.2

6 release files

0.1.1

6 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