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.1

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.1
File
rulebearing-0.1.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
rulebearing-0.1.1-py3-none-musllinux_1_1_x86_64.whl Python 3 none Linux musl 1.1+ x86-64 Details
rulebearing-0.1.1-py3-none-manylinux_2_39_x86_64.whl Python 3 none Linux glibc 2.39+ x86-64 Details
rulebearing-0.1.1-py3-none-manylinux_2_39_aarch64.whl Python 3 none Linux glibc 2.39+ ARM64 Details
rulebearing-0.1.1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
rulebearing-0.1.1-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.1-py3-none-win_amd64.whl

Download URL rulebearing-0.1.1-py3-none-win_amd64.whl
Size 9.9 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
7816243dd370acc521bbeaee3f8c8d60934a60b37c047a33a9653be0d6218e41
BLAKE2b-256 checksum
How to use checksums
2ac8c7a9a94c1c82984eca380a5b9a869e90b579df3ae27374be8aa35ca975b5
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.1-py3-none-musllinux_1_1_x86_64.whl

Download URL rulebearing-0.1.1-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
b5847a1d327e4cc1277a518dc226665e6eb1e225f47601be44ea8ee5aad8f78c
BLAKE2b-256 checksum
How to use checksums
f799e6c7b7580800d797a5f807f5894a25d49f706bb43c2f631f261f6de6cd2d
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.1-py3-none-manylinux_2_39_x86_64.whl

Download URL rulebearing-0.1.1-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
01b920b3fb406622efab0946615c7d8ed175d1a4eb7d2d072304e94be5d03cb3
BLAKE2b-256 checksum
How to use checksums
13f4c65645bebdc330ea142af8ca5bfc7c972fe0b96a80a810a7aae2b2b0e41a
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.1-py3-none-manylinux_2_39_aarch64.whl

Download URL rulebearing-0.1.1-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
6f44ca032d9779d7ad3e8456dd9d7e2a341e050df28153f8e15860fa97f90ecc
BLAKE2b-256 checksum
How to use checksums
52bb918ada8ead94b67da336096a327daf1b52db98ba5f6ac9ff0f1609d23c86
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.1-py3-none-macosx_11_0_arm64.whl

Download URL rulebearing-0.1.1-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
0625b1f0d747c99078e67d957d4f93a71329f984c89a253bb32087bac51bc5cc
BLAKE2b-256 checksum
How to use checksums
15ac835e17cb27612a651acadc99daf850530c9280573a38d16b87f9c559bfed
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.1-py3-none-macosx_10_12_x86_64.whl

Download URL rulebearing-0.1.1-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
5c982c69cdc7c40ea0f01c5a3b59dec651ae0c03742a74868f83a55430c04d8d
BLAKE2b-256 checksum
How to use checksums
1b9c5ed53fd22792fc5f3de18b2514c453259aa453ac78096949450f4ca6fee3
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

0.1.3

6 release files

0.1.2

6 release files

This release

0.1.1 This release

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