.\" Man page generated from reStructuredText. . .TH PYBUILD 1 "" "" "" .SH NAME pybuild \- invokes various build systems for requested Python versions in order to build modules and extensions . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 pybuild [ACTION] [BUILD SYSTEM ARGUMENTS] [DIRECTORIES] [OPTIONS] .UNINDENT .UNINDENT .SH DEBHELPER COMMAND SEQUENCER INTEGRATION .INDENT 0.0 .IP \(bu 2 build depend on \fIdh\-python\fP, .IP \(bu 2 build depend on all supported Python interpreters, pybuild will use it to create a list of interpreters to build for. Recognized dependencies: .INDENT 2.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 \fIpython3\-all\-dev\fP \- for Python extensions that work with Python 3.X interpreters, .IP \(bu 2 \fIpython3\-all\-dbg\fP \- as above, add this one if you\(aqre building \-dbg packages, .IP \(bu 2 \fIpython3\-all\fP \- for Python modules that work with Python 3.X interpreters, .IP \(bu 2 \fIpython3\-dev\fP \- builds an extension for default Python 3.X interpreter (useful for private extensions, use python3\-all\-dev for public ones), .IP \(bu 2 \fIpython3\fP \- as above, used if headers files are not needed to build private module, .IP \(bu 2 \fIpython\-all\-dev\fP \- for Python extensions that work with obsolete Python 2.X interpreters, .IP \(bu 2 \fIpython\-all\-dbg\fP \- as above, add this one if you\(aqre building \-dbg packages, .IP \(bu 2 \fIpython\-all\fP \- for Python modules that work with obsolete Python 2.X interpreters, .IP \(bu 2 \fIpypy\fP \- for PyPy 2.X interpreter. .UNINDENT .UNINDENT .UNINDENT .IP \(bu 2 add \fI\-\-buildsystem=pybuild\fP to dh\(aqs arguments in debian/rules, .IP \(bu 2 if more than one binary package is build: add debian/python\-foo.install files, or \fIexport PYBUILD_NAME=modulename\fP (modulename will be used to guess binary package prefixes), or \fIexport PYBUILD_DESTDIR\fP env. variables in debian/rules .IP \(bu 2 add \fI\-\-with=python3\fP or \fI\-\-with=python3,python2,pypy\fP to dh\(aqs arguments in debian/rules (see proper helper\(aqs manpage for more details) or add \fIdh\-sequence\-python3\fP (\fIdh\-sequence\-python2\fP for Python 2.X, \fIdh\-sequence\-pypy\fP for PyPy) to Build\-Depends .UNINDENT .sp debian/rules file example: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C #! /usr/bin/make \-f export PYBUILD_NAME=foo %: dh $@ \-\-with python2,python3 \-\-buildsystem=pybuild .ft P .fi .UNINDENT .UNINDENT .SH OPTIONS .INDENT 0.0 .INDENT 3.5 Most options can be set (in addition to command line) via environment variables. PyBuild will check: .INDENT 0.0 .IP \(bu 2 PYBUILD_OPTION_VERSIONED_INTERPRETER (f.e. PYBUILD_CLEAN_ARGS_python3.2) .IP \(bu 2 PYBUILD_OPTION_INTERPRETER (f.e. PYBUILD_CONFIGURE_ARGS_python3\-dbg) .IP \(bu 2 PYBUILD_OPTION (f.e. PYBUILD_INSTALL_ARGS) .UNINDENT .UNINDENT .UNINDENT .SS optional arguments .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .TP .B \-h\fP,\fB \-\-help show this help message and exit .TP .B \-v\fP,\fB \-\-verbose turn verbose mode on .TP .B \-q\fP,\fB \-\-quiet doesn\(aqt show external command\(aqs output .TP .BI \-q\fB q\fR,\fB \ \-\-really\-quiet be quiet .TP .B \-\-version show program\(aqs version number and exit .UNINDENT .UNINDENT .UNINDENT .SS ACTION .INDENT 0.0 .INDENT 3.5 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. .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .TP .B \-\-detect return the name of detected build system .TP .B \-\-clean clean files using auto\-detected build system specific methods .TP .B \-\-configure invoke configure step for all requested Python versions .TP .B \-\-build invoke build step for all requested Python versions .TP .B \-\-install invoke install step for all requested Python versions .TP .B \-\-test invoke tests for auto\-detected build system .TP .B \-\-list\-systems list available build systems and exit .TP .B \-\-print print pybuild\(aqs internal parameters .UNINDENT .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SS TESTS .INDENT 0.0 .INDENT 3.5 unittest\(aqs discover from standard library (available in Python 2.7 and >= 3.2) is used in test step by default. .INDENT 0.0 .TP .B \-\-test\-nose use nose module in test step, remember to add python\-nose and/or python3\-nose to Build\-Depends .TP .B \-\-test\-nose2 use nose2 module in test step, remember to add python\-nose2 and/or python3\-nose2 to Build\-Depends .TP .B \-\-test\-pytest use pytest module in test step, remember to add python\-pytest and/or python3\-pytest to Build\-Depends .TP .B \-\-test\-tox use tox command in test step, remember to add tox to Build\-Depends. Requires tox.ini file .UNINDENT .UNINDENT .UNINDENT .SS testfiles .INDENT 0.0 .INDENT 3.5 Tests are invoked from within build directory to make sure newly built files are tested instead of source files. If test suite requires other files in this directory, you can list them in \fIdebian/pybuild.testfiles\fP file (you can also use \fIdebian/pybuild_pythonX.testfiles\fP or \fIdebian/pybuild_pythonX.Y.testfiles\fP) and files listed there will be copied before test step and removed before install step. By default only \fItest\fP and \fItests\fP directories are copied to build directory. .UNINDENT .UNINDENT .SS BUILD SYSTEM ARGUMENTS .INDENT 0.0 .INDENT 3.5 Additional arguments passed to the build system. \-\-system=custom requires complete command in \-\-foo\-args parameters. .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .TP .BI \-\-before\-clean \ COMMAND invoked before the clean command .TP .BI \-\-clean\-args \ ARGUMENTS arguments added to clean command generated by build system plugin .TP .BI \-\-after\-clean \ COMMAND invoked after the clean command .TP .BI \-\-before\-configure \ COMMAND invoked before the configure command .TP .BI \-\-configure\-args \ ARGUMENTS arguments added to configure command generated by build system plugin .TP .BI \-\-after\-configure \ COMMAND invoked after the configure command .TP .BI \-\-before\-build \ COMMAND invoked before the build command .TP .BI \-\-build\-args \ ARGUMENTS arguments added to build command generated by build system plugin .TP .BI \-\-after\-build \ COMMAND invoked after the build command .TP .BI \-\-before\-install \ COMMAND invoked before the install command .TP .BI \-\-install\-args \ ARGUMENTS arguments added to install command generated by build system plugin .TP .BI \-\-after\-install \ COMMAND invoked after the install command .TP .BI \-\-before\-test \ COMMAND invoked before the test command .TP .BI \-\-test\-args \ ARGUMENTS arguments added to test command generated by build system plugin .TP .BI \-\-after\-test \ COMMAND invoked after the test command .UNINDENT .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SS variables that can be used in \fIARGUMENTS\fP and \fICOMMAND\fP .INDENT 0.0 .IP \(bu 2 \fI{version}\fP will be replaced with current Python version, you can also use \fI{version.major}\fP, \fI{version.minor}\fP, etc. .IP \(bu 2 \fI{interpreter}\fP will be replaced with current interpreter, you can also use \fI{interpreter.include_dir}\fP .IP \(bu 2 \fI{dir}\fP will be replaced with sources directory, .IP \(bu 2 \fI{destdir}\fP will be replaced with destination directory, .IP \(bu 2 \fI{home_dir}\fP will be replaced with temporary HOME directory, where plugins can keep their data (.pybuild/interpreter_version/ by default), .IP \(bu 2 \fI{build_dir}\fP will be replaced with build directory .IP \(bu 2 \fI{install_dir}\fP will be replaced with install directory. .IP \(bu 2 \fI{package}\fP will be replaced with suggested package name, if \-\-name (or PYBUILD_NAME) is set to \fIfoo\fP, this variable will be replaced to \fIpython\-foo\fP, \fIpython3\-foo\fP or \fIpypy\-foo\fP depending on interpreter which is used in given iteration. .UNINDENT .SS DIRECTORIES .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .TP .BI \-d \ DIR\fR,\fB \ \-\-dir \ DIR set source files directory \- base for other relative dirs [by default: current working directory] .TP .BI \-\-dest\-dir \ DIR set destination directory [default: debian/tmp] .TP .BI \-\-ext\-dest\-dir \ DIR set destination directory for .so files .TP .BI \-\-ext\-pattern \ PATTERN regular expression for files that should be moved if \-\-ext\-dest\-dir is set [default: \fI\&.so(.[^/]*)?$\fP] .TP .BI \-\-ext\-sub\-pattern \ PATTERN regular expression for part of path/filename matched in \-\-ext\-pattern that should be removed or replaced with \-\-ext\-sub\-repl .TP .BI \-\-ext\-sub\-repl \ PATTERN replacement for matches in \-\-ext\-sub\-pattern .TP .BI \-\-install\-dir \ DIR set installation directory [default: .../dist\-packages] .TP .BI \-\-name \ NAME use this name to guess destination directories (depending on interpreter, "foo" sets debian/python\-foo, debian/python3\-foo, debian/python3\-foo\-dbg, etc.) .UNINDENT .UNINDENT .UNINDENT .SS variables that can be used in \fIDIR\fP .INDENT 0.0 .IP \(bu 2 \fI{version}\fP will be replaced with current Python version, .IP \(bu 2 \fI{interpreter}\fP will be replaced with selected interpreter. .UNINDENT .SS LIMITATIONS .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .TP .BI \-s \ SYSTEM\fR,\fB \ \-\-system \ SYSTEM select a build system [default: auto\-detection] .TP .BI \-p \ VERSIONS\fR,\fB \ \-\-pyver \ VERSIONS 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. .TP .BI \-i \ INTERPRETER\fR,\fB \ \-\-interpreter \ INTERPRETER change interpreter [default: python{version}] .TP .BI \-\-disable \ ITEMS disable action, interpreter, version or any mix of them. Note that f.e. python3 and python3\-dbg are two different interpreters, \-\-disable test/python3 doesn\(aqt disable python3\-dbg\(aqs tests. .UNINDENT .UNINDENT .UNINDENT .SS disable examples .INDENT 0.0 .IP \(bu 2 \fI\-\-disable test/python2.5\-dbg\fP \- disables tests for python2.5\-dbg .IP \(bu 2 \fI\-\-disable \(aq2.4 2.7\(aq\fP \- disables all actions for version 2.4 and 2.7 .IP \(bu 2 \fIPYBUILD_DISABLE_python2=1\fP \- disables all actions for Python 2.X .IP \(bu 2 \fIPYBUILD_DISABLE_python3.3=test\fP \- disables tests for Python 3.3 .IP \(bu 2 \fIPYBUILD_DISABLE=test/python3.3\fP \- same as above .IP \(bu 2 \fIPYBUILD_DISABLE=configure/python3 2.4 pypy\fP \- disables configure action for all python3 interpreters, all actions for version 2.4, and all actions for pypy .UNINDENT .SS PLUGINS .sp pybuild supports multiple build system plugins. By default it is automatically selected. These systems are currently supported: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C * distutils (most commonly used) * cmake * flit * custom .ft P .fi .UNINDENT .UNINDENT .SS flit plugin .sp The flit plugin can be used to build Debian packages based on PEP 517 metadata in \fIpyproject.toml\fP when flit is the upstream build system. These can be identified by the presence of a \fIbuild\-backend = "flit_core.buildapi"\fP element in \fIpyproject.toml\fP\&. The flit plugin only supports python3. To use this plugin: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C * build depend on \(gaflit\(ga and either * build depend on \(gapython3\-toml\(ga so flit can be automatically selected or * add \(gaexport PYBUILD_SYSTEM=flit\(ga to debian/rules to manually select .ft P .fi .UNINDENT .UNINDENT .sp debian/rules file example: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C #! /usr/bin/make \-f export PYBUILD_NAME=foo export PYBUILD_SYSTEM=flit (needed if python3\-toml is not installed) %: dh $@ \-\-with python3 \-\-buildsystem=pybuild .ft P .fi .UNINDENT .UNINDENT .SH SEE ALSO .INDENT 0.0 .IP \(bu 2 dh_python2(1) .IP \(bu 2 dh_python3(1) .IP \(bu 2 \fI\%https://wiki.debian.org/Python/Pybuild\fP .IP \(bu 2 \fI\%http://deb.li/pybuild\fP \- most recent version of this document .UNINDENT .SH AUTHOR Piotr Ożarowski, 2012-2019 .\" Generated by docutils manpage writer. .