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.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| rulebearing-0.1.2-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| rulebearing-0.1.2-py3-none-musllinux_1_1_x86_64.whl | Python 3 | none | Linux musl 1.1+ x86-64 | Details |
| rulebearing-0.1.2-py3-none-manylinux_2_39_x86_64.whl | Python 3 | none | Linux glibc 2.39+ x86-64 | Details |
| rulebearing-0.1.2-py3-none-manylinux_2_39_aarch64.whl | Python 3 | none | Linux glibc 2.39+ ARM64 | Details |
| rulebearing-0.1.2-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
| rulebearing-0.1.2-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.2-py3-none-win_amd64.whl
| Download URL | rulebearing-0.1.2-py3-none-win_amd64.whl |
|---|---|
| Size | 9.9 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
fb443712000d7b26401dad6c5759bafe457540d687ff44658ddf9ad99bfad41d
|
|
BLAKE2b-256 checksum How to use checksums |
4a08a1840ba45b1194d5d1cc3927a4e8966ad542173269b3a8562d46ea3f752e
|
| 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.2-py3-none-musllinux_1_1_x86_64.whl
| Download URL | rulebearing-0.1.2-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 |
7408f6192322ea85d557f371b2ed305cd6a366ebda44d1c6028a31a11323c839
|
|
BLAKE2b-256 checksum How to use checksums |
8726133378fc68adb35ca8114ef731be75ea9f3a027953ed77bc62c231fbfd38
|
| 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.2-py3-none-manylinux_2_39_x86_64.whl
| Download URL | rulebearing-0.1.2-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 |
0f8a6448c96e3d86f1aeab9248094e14925787e6641858d062e7195cdf6941d7
|
|
BLAKE2b-256 checksum How to use checksums |
6f11b0097c093b5c450af7873cf81323ea321d06a34d6dbb9018d2afcf29cf06
|
| 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.2-py3-none-manylinux_2_39_aarch64.whl
| Download URL | rulebearing-0.1.2-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 |
2ed03de5d9a229691aae2343ccdad4dd79b8746e45732c315c5ebc0e0d773a68
|
|
BLAKE2b-256 checksum How to use checksums |
d0afaaa5aad4cc21e2f2ee3c096b7f7aefc1254626641cba24cbebf12395f4f3
|
| 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.2-py3-none-macosx_11_0_arm64.whl
| Download URL | rulebearing-0.1.2-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 |
c1c85be1ec5bce09327f15161f4fb79d93a78f5f7bf3502aa30029fed6b1508a
|
|
BLAKE2b-256 checksum How to use checksums |
bd60e9e1fca33be818eb1ca6f682011ef03d97a58b06b44ede33d0af5251976e
|
| 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.2-py3-none-macosx_10_12_x86_64.whl
| Download URL | rulebearing-0.1.2-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 |
1f9b9dda0bf060231cdbdb13e1220e5303b576e909d46ee28dda788ab07a23c8
|
|
BLAKE2b-256 checksum How to use checksums |
5cf79a1acd887e80efa1c78edd2a9d171d344447686eb7aba21fd942218d5346
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.17
|