Binary Dependency Utility
Bindep is a command-line utility for checking the presence of binary packages required by an application or library. It helps manage operating system-level package dependencies, particularly in development and CI environments, and originated from the OpenStack project to ensure necessary system packages are installed before Python dependencies. The current version is 2.14.0, requiring Python >=3.8, and it follows an irregular, as-needed release cadence.
Warnings
- gotcha The primary dependency file used by bindep is `bindep.txt`. However, older projects or documentation might refer to `other-requirements.txt`, which was the previous default location. Bindep will fall back to `other-requirements.txt` if `bindep.txt` is not found.
- breaking Malformed `bindep.txt` files, such as those missing a trailing newline or containing invalid characters in profile names (e.g., uppercase or underscores), can lead to `ParseError` or difficult-to-debug build failures.
- gotcha Binary package names vary significantly across different operating systems and distributions (e.g., `libxml2-dev` on Debian-based systems vs. `libxml2-devel` on RPM-based systems). Without proper platform profiles, `bindep` might incorrectly report missing packages or fail to identify the correct ones.
- gotcha The `bindep` CLI exit code `1` is overloaded, indicating either 'file not found/reading errors' or 'missing/incompatible packages'. This ambiguity can make automated parsing and error handling challenging.
Install
-
pip install bindep
Imports
- bindep CLI
bindep <options>
Quickstart
echo "grep" > bindep.txt echo "python3-dev [platform:debian]" >> bindep.txt echo "python3-devel [platform:rhel]" >> bindep.txt # To check for missing packages: bindep --brief # Example of checking a specific profile (e.g., 'debian') bindep --profile debian --brief