Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Packaging a Python app with PyPI + OS-level dependencies

I would like to package a Python scientific application for PyPI. My problem is that it relies on PyPI-level deps (e.g. numpy, scipy, etc.) as well as others which must be dealt at the OS-level: wxPython and Python-VTK (e.g. with apt-get on Ubuntu, homebrew on OSX, etc).

I'd like to know what would be the ideal strategy for doing this, and in particular, which packaging system would fit best (I'm currently favoring Distribute).

like image 852
cjauvin Avatar asked Jul 16 '12 16:07

cjauvin


People also ask

How do I package a Python application?

Use PyInstaller, py2exe, Nuitka, or another bundling solution. The most convenient way to deliver a Python application to a user is to provide them with an executable—either a single file or a directory with an easily identified executable somewhere in it.


1 Answers

distribute is a fork of setuptools with better perhaps documentation. You basically have distutils (stdlib) and setuptools as your choices. Since distutils doesn't let you specify dependencies, only setuptools is left.

You generally list all dependencies, and document the installation procedure clearly (including in the long_description field pushed to PyPI). Include the OS-level installed packages, most distributions include the egg information when installing these.

like image 179
Martijn Pieters Avatar answered Oct 12 '22 16:10

Martijn Pieters