Python Build Reasonableness (PBR)

7.0.3 · active · verified Sun Mar 29

PBR (Python Build Reasonableness) is a library developed by OpenStack that injects useful and sensible default behaviors into setuptools-based Python projects. It automates common packaging tasks such as version management based on Git tags, generation of AUTHORS and ChangeLog files from Git history, handling dependencies via requirements files, and automatic long descriptions from READMEs. It aims to simplify the `setup.py` and `setup.cfg` configuration for consistent and repeatable builds. The current version is 7.0.3, with an active release cadence tied to OpenStack development cycles.

Warnings

Install

Imports

Quickstart

To use PBR, you need a minimal `setup.py` file that calls `setuptools.setup()` and sets `pbr=True`. Most of your project metadata and configuration (e.g., name, dependencies, entry points, versioning strategy) will reside in `setup.cfg` and, for modern Python packaging, in `pyproject.toml`. PBR then processes these configuration files to provide default behaviors and inject values into `setuptools`.

import setuptools

# setup.py
setuptools.setup(
    setup_requires=['pbr>=2.0.0'],
    pbr=True,
)

# --- setup.cfg ---
# [metadata]
# name = my-package
# author = Your Name
# author-email = your@email.com
# summary = A short summary of my package
# description-file = README.rst
# license = MIT
# classifier =
#     Development Status :: 4 - Beta
#     Programming Language :: Python
# keywords = example, packaging
# 
# [files]
# packages = my_package
# 
# [entry_points]
# console_scripts =
#     my-command = my_package.cli:main
# 
# --- pyproject.toml (for modern projects) ---
# [build-system]
# requires = ["pbr>=7.0.0", "setuptools>=61.0.0", "wheel"]
# build-backend = "pbr.build"

view raw JSON →