Quick guide to packaging python libraries

February 09, 2015 at 06:22 PM | categories: python, packaging, ubuntu | View Comments

The short and simple guide to installing python packages for Ubuntu:

  • Install python-stdeb
  • Build an sdist version of your package, make sure it's all good
  • Run py2dsc on the library, debuild the resulting package
  • Install

That's probably a little terse, but gets over how simple this can be if you can ensure that your package's sdist builds cleanly.

Short example of steps involved:

sudo apt-get install python-stdeb

tar zxvf guild-0.1.0.tar.gz
cd guild-0.1.0/
python setup.py sdist
cd dist

py2dsc guild-0.1.0.tar.gz
cd deb_dist
cd guild-0.1.0
debuild -uc -us

cd ..
sudo dpkg -i python-guild_0.1.0-1_all.deb

(This has been languishing in my drafts folder for a while, so I've shortened to post)

blog comments powered by Disqus