PyBuilder
raw JSON → 0.13.20 verified Fri May 01 auth: no python
PyBuilder is a build automation tool for Python, offering a declarative approach to managing project builds, dependencies, testing, and packaging. Current version is 0.13.20 with a stable release cadence.
pip install pybuilder Common errors
error ModuleNotFoundError: No module named 'pybuilder' ↓
cause PyBuilder not installed or wrong Python environment.
fix
Install with 'pip install pybuilder' and ensure you're in the correct virtualenv.
error pyb: command not found ↓
cause The 'pyb' script is not on PATH after pip install.
fix
Use 'python -m pybuilder' or add the scripts directory to PATH (e.g., '$(python -m site --user-base)/bin').
error 'NoneType' object has no attribute 'set_property' ↓
cause Using @init decorator without importing 'init' from pybuilder.core.
fix
Add 'from pybuilder.core import init' to the top of build.py.
error AttributeError: module 'pybuilder' has no attribute 'core' ↓
cause Importing 'pybuilder' directly instead of submodules.
fix
Use 'from pybuilder.core import ...' or 'import pyb' (if using deprecated path).
Warnings
breaking PyBuilder 0.13.0 dropped support for Python 2 and older Python 3 versions; requires Python >=3.10. ↓
fix Upgrade to Python 3.10+.
gotcha By default, PyBuilder uses pip for dependency resolution, not pipenv or poetry. Mixing tools may cause conflicts. ↓
fix Stick to PyBuilder's built-in dependency management via build.py or use 'pyb install_dependencies'.
deprecated The 'pyb' command may be missing from PATH after pip install; use 'python -m pybuilder' to invoke. ↓
fix Run 'python -m pybuilder' instead of 'pyb', or add site-packages/bin to PATH.
Imports
- pyb
import pyb
Quickstart
from pybuilder.core import use_plugin, init
@init
def set_properties(project):
project.set_property('name', 'myproject')
project.set_property('version', '1.0')
project.set_property('dir_source_main_python', 'src/main/python')
project.set_property('dir_source_unittest_python', 'src/unittest/python')
# Build script: save as build.py, then run: pyb