From: https://pypi.python.org/pypi/stdeb/0.8.5#examples
Example for package Reindent
Download source code:
wget http://pypi.python.org/packages/source/R/Reindent/Reindent-0.1.0.tar.gz
You may need to install these dependencies:
sudo apt install python3-all dh-python python3-stdeb
Alternatively, create a virtualenv:
virtualenv /tmp/deb_export
. /tmp/deb_export/bin/activate
pip install stdeb
From the directory where the tar ball is:
PKG=Reindent; echo $PKG && py2dsc `ls $PKG-*tar.gz` && cd deb_dist/$PKG-* && dpkg-buildpackage -rfakeroot -uc -us && cd .. && ls python*-$PKG*.deb