Skip to main content

Catch upstream Python dependency breakage before it surprises your CI build

Project description

buildguard

Catch upstream Python dependency breakage before it surprises your CI build.

buildguard is a deterministic CLI that creates a clean virtual environment, attempts to install your pinned dependency set, and fails early when upstream package ecosystem drift breaks installation.

It is intended as a preflight install check for CI.

Licensing:

  • free for personal and other non-commercial use
  • paid commercial license required for business, client, or other commercial use
  • no activation, unlock flow, or license-file check in the CLI

Common upstream drift this catches includes:

  • versions disappearing
  • wheels removed from package indexes
  • build backend behavior changes
  • dependency resolution breakage
  • incompatible metadata changes
  • missing distributions for a Python version or platform

buildguard is not:

  • a vulnerability scanner
  • a dependency resolver
  • a lockfile manager
  • a license scanner

Quick Start

buildguard check requirements.txt
buildguard check requirements.txt --json

Installation

Install from the repository root:

python3 -m pip install .

CI Example

GitHub Actions:

name: Buildguard Preflight

on:
  push:
  pull_request:

jobs:
  buildguard:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - run: python -m pip install .

      - run: buildguard check requirements.txt

Legacy Interpreter Notes

If you are validating against an older Python interpreter (for example --python python3.6), use --no-upgrade-tools. This skips pip/setuptools/wheel upgrades inside the temporary venv and is often more stable for legacy interpreter tests.

If the pip wrapper binary is broken on your machine for that interpreter, use --python-m-pip so buildguard runs pip as python -m pip inside the temporary venv.

When needed, you can pin build tool versions during the upgrade step:

  • --pip-version <version>
  • --setuptools-version <version>
  • --wheel-version <version>

These options require tool upgrades to be enabled (do not combine with --no-upgrade-tools).

Development

Editable install:

python3 -m pip install -e . --no-build-isolation

Optional local venv setup:

bash scripts/setup_local_venv.sh

Smoke tests:

python scripts/smoke_test_check_success.py
python scripts/smoke_test_check_failure.py
python scripts/smoke_test_missing_distribution.py

Publishing

PyPI publishing is handled by the GitHub Actions workflow at publish-pypi.yml.

Example Output

Success:

buildguard check: requirements.txt
python: python3.11
venv: /tmp/buildguard-abc123

PASS

requirements installed successfully in a clean environment

summary:
elapsed_seconds=18.4
pip_exit_code=0

Failure:

buildguard check: requirements.txt
python: python3.11
venv: /tmp/buildguard-abc123

FAIL

pip install -r requirements.txt exited with code 1

likely failing dependency:
uvloop==0.17.0

pip error summary:
Failed building wheel for uvloop
error: subprocess-exited-with-error

summary:
elapsed_seconds=22.7
pip_exit_code=1

Exit Codes

  • 0: success
  • 1: install failure
  • 2: fatal tool/runtime/config error

Why This Exists

Upstream dependency ecosystem changes can break installs unexpectedly and waste CI time. buildguard makes dependency installation a deliberate, fail-fast preflight step.

Support Scope

buildguard v1 is intentionally small and practical. It focuses on deterministic preflight install checks for one requirements file.

License

See LICENSE.txt for the free personal-use terms and COMMERCIAL_LICENSE.md for the commercial licensing model.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

buildguard-0.1.0.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

buildguard-0.1.0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file buildguard-0.1.0.tar.gz.

File metadata

  • Download URL: buildguard-0.1.0.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for buildguard-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5030c751f9c0d2fd012f2f513ff88c8a7f8b675b96b3c035a8d94ff7adf6c3b4
MD5 c15eee2b6cecba4cdb0633ff72f23164
BLAKE2b-256 863447823d3034d29b6723c632f3d7a95ff3c4a64bd78f56795bbae0229d0040

See more details on using hashes here.

Provenance

The following attestation bundles were made for buildguard-0.1.0.tar.gz:

Publisher: publish-pypi.yml on heffman/buildguard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file buildguard-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: buildguard-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for buildguard-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47d114f7e401cb2c66947a79339c2535a11da27db32820d841705c349cb980f3
MD5 0228371f239a540c7aaea928bae9a700
BLAKE2b-256 a43c65241d35fddc6d2495ae8f0e695d410af5ef172fd36bfe24529d6c5b6efa

See more details on using hashes here.

Provenance

The following attestation bundles were made for buildguard-0.1.0-py3-none-any.whl:

Publisher: publish-pypi.yml on heffman/buildguard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page