Linux Commands Examples

A great documentation place for Linux commands


invokes various build systems for requested Python versions in order to build modules and extensions

see also : dh_python2 - dh_python3



add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!


no example yet ...

... Feel free to add your own example above to help other Linux-lovers !


Most options can be set (in addition to command line) via environment variables. PyBuild will check:




optional arguments

-h, --help

show this help message and exit

-v, --verbose

turn verbose mode on

-q, --quiet

doesn't show external command's output

-qq, --really-quiet

be quiet


show program's version number and exit


The default is to build, install and test the library using detected build system version by version. Selecting one of following actions, will invoke given action for all versions - one by one - which (contrary to the default action) in some build systems can overwrite previous results.


return the name of detected build system


clean files using auto-detected build system specific methods


invoke configure step for all requested Python versions


invoke build step for all requested Python versions


invoke install step for all requested Python versions


invoke tests for auto-detected build system


list available build systems and exit


Additional arguments passed to the build system. --system=custom requires complete command.

--before-clean COMMAND

invoked before the clean command

--clean-args ARGUMENTS

arguments added to clean command generated by build system plugin

--after-clean COMMAND

invoked after the clean command

--before-configure COMMAND

invoked before the configure command

--configure-args ARGUMENTS

arguments added to configure command generated by build system plugin

--after-configure COMMAND

invoked after the configure command

--before-build COMMAND

invoked before the build command

--build-args ARGUMENTS

arguments added to build command generated by build system plugin

--after-build COMMAND

invoked after the build command

--before-install COMMAND

invoked before the install command

--install-args ARGUMENTS

arguments added to install command generated by build system plugin

--after-install COMMAND

invoked after the install command

--before-test COMMAND

invoked before the test command

--test-args ARGUMENTS

arguments added to test command generated by build system plugin

--after-test COMMAND

invoked after the test command

variables that can be used in ARGUMENTS and COMMAND

{version} will be replaced with current Python version,

{interpreter} will be replaced with current interpreter,

{dir} will be replaced with sources directory,

{destdir} will be replaced with destination directory,

{home_dir} will be replaced with temporary HOME directory, where plugins can keep their data (.pybuild/interpreter_version/ by default),

{build_dir} will be replaced with build directory

{install_dir} will be replaced with install directory.


-d DIR, --dir DIR

set source files directory - base for other relative dirs [by default: current working directory]

--dest-dir DIR

set destination directory [default: debian/tmp]

--ext-dest-dir DIR

set destination directory for .so files

--ext-pattern PATTERN

regular expression for files that should be moved if --ext-destdir is set [default: .so(.[^/]*)?$]

--install-dir DIR

set installation directory [default: .../dist-packages]

variables that can be used in DIR

{version} will be replaced with current Python version,

{interpreter} will be replaced with selected interpreter.


-s SYSTEM, --system SYSTEM

select a build system [default: auto-detection]


build for Python VERSIONS. This option can be used multiple times. Versions can be separated by space character. The default is all Python 3.X supported versions.


change interpreter [default: python{version}]

--disable ITEMS

disable action, interpreter, version or any mix of them.

disable examples

--disable test/python2.5-dbg - disables tests for python2.5-dbg

--disable '2.4 2.7' - disables all actions for version 2.4 and 2.7

PYBUILD_DISABLE_python2=1 - disables all actions for Python 2.X

PYBUILD_DISABLE_python3.3=test - disables tests for Python 3.3

PYBUILD_DISABLE=test/python3.3 - same as above

PYBUILD_DISABLE='configure/python3 2.4 pypy' - disables configure action for all python3 interpreters, all actions for version 2.4, and all actions for pypy

debhelper command sequencer integration

build depend on python3 (>= 3.3.0-2)

add "--buildsystem=pybuild" to dh's arguments in debian/rules

if more than one binary package is build: add debian/python-foo.install files, or export PYBUILD_DESTDIR env. variables in debian/rules

debian/rules file example:

export PYBUILD_DESTDIR_python2=debian/python-foo/
export PYBUILD_DESTDIR_python2-dbg=debian/python-foo-dbg/
export PYBUILD_DESTDIR_python3=debian/python3-foo/
export PYBUILD_DESTDIR_python3-dbg=debian/python3-foo-dbg/
       dh $@ --with python2,python3 --buildsystem=pybuild

see also


dh_python3 - most recent version of this document


Piotr Ożarowski, 2012-2013

How can this site be more helpful to YOU ?

give  feedback