LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

dh-python

debhelper extensions for Python packaging

TLDR

Build Python 3 package with debhelper
$ dh_python3
copy
Specify supported Python versions
$ dh_python3 --shebang=/usr/bin/python3
copy
Build with specific Python package directory
$ dh_python3 -p [package-name]
copy
Generate dependencies from requires.txt
$ dh_python3 --depends
copy

SYNOPSIS

dh_python3 [options]dh_python2 [options] (deprecated)

DESCRIPTION

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.

PARAMETERS

-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.
-Oopt
Pass option to debhelper.

INSTALL

yay -S dh-python
copy

CAVEATS

Python 2 support (dh_python2) is deprecated and removed from modern Debian. Multiple Python versions require careful handling. Virtual environments are not directly supported; packages install to system directories. Byte-compilation errors may indicate syntax issues.

HISTORY

dh-python was developed for Debian to replace the older python-support and python-central systems. Created by Piotr Ożarowski around 2012, it provided a cleaner approach to Python packaging as Python 3 became standard. The tool became the standard method for Debian Python packages and is used by Ubuntu and derivatives.

SEE ALSO

pybuild(1), dh(1), debhelper(7)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid