Linux command
dh-python 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Build Python 3 package with debhelper
dh_python3
Specify supported Python versions
dh_python3 --shebang=/usr/bin/python3
Build with specific Python package directory
dh_python3 -p [package-name]
Generate dependencies from requires.txt
dh_python3 --depends
说明
dh-python provides debhelper extensions for packaging Python modules and applications in Debian. The main commands are dh_python3 for Python 3 packages and the deprecated dh_python2 for Python 2. These tools handle Python-specific packaging tasks: byte-compiling modules, generating dependencies from Python metadata, fixing shebangs to use system Python, and creating proper package relationships. In debian/rules, dh_python3 is typically invoked automatically through the dh sequencer with --with python3. It reads configuration from debian/control and Python metadata files.
参数
- -p, --package _package_
- Act on specified package.
- -n, --no-package _package_
- Exclude package.
- --shebang _path_
- Use specific Python interpreter in shebangs.
- --depends _section_
- Generate dependencies from specified section.
- --recommends _section_
- Generate recommends from specified section.
- --suggests _section_
- Generate suggests from specified section.
- -v, --verbose
- Verbose output.
- -O_opt_
- Pass option to debhelper.
FAQ
What is the dh-python command used for?
dh-python provides debhelper extensions for packaging Python modules and applications in Debian. The main commands are dh_python3 for Python 3 packages and the deprecated dh_python2 for Python 2. These tools handle Python-specific packaging tasks: byte-compiling modules, generating dependencies from Python metadata, fixing shebangs to use system Python, and creating proper package relationships. In debian/rules, dh_python3 is typically invoked automatically through the dh sequencer with --with python3. It reads configuration from debian/control and Python metadata files.
How do I run a basic dh-python example?
Run `dh_python3` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -p, --package _package_ do in dh-python?
Act on specified package.