[[:home | Home]] [[:proj:project | Project]] ====== Packaging Strategies ====== ===== Modular vs Self-Contained ===== ==== Overview ==== There are two schools of thought when it comes to installing applications. The first, common to Windows and Mac OS X, is that applications should be self-contained, and their installation should not depend on anything else. This philosophy simplifies the management of applications: each application is its own standalone "appliance", and installing and removing them should not disturb the rest of the OS. If the application needs an uncommon library, that library is included in the application's distribution. The second school, which is the norm for Linux-based systems, treats software as a collection of small self-contained units called packages. Libraries are bundled into packages, any given library package might depend on other packages. Installing an application might involve finding and installing particular versions of dozens of other libraries. These dependencies are usually fetched from a central repository that contains thousands of packages. This philosophy is why Linux distributions use complex package management systems like dpkg and RPM to track dependencies and prevent installation of two applications that use incompatible versions of the same library. There are pros and cons to each approach. [emphasis added] http://www.aosabook.org/en/packaging.html ==== Problems with Other Packages ==== ... the problem comes in when your users may need different versions of packages, i.e. numpy1.5 vs. numpy1.6 -- then things get ugly. wxPython (and a few others) have a way top manage versions (wxversion), but there is no standard way to do it in python, and most packages have no way to handle multiple versions installed. And when you have things like numpy, MPL, scipy -- they all have to be compatible. Christopher Barker - wxPython thread ===== Bundling up For Windows and Mac ===== ==== Binary vs Code Bundles ==== Fortunately, there is virtualenv and friends for the folks that distribute (and run) applications from source code, and py2exe and friends for folks that want a "binary". Christopher Barker - wxPython thread ==== Making Binaries ==== Yes, py2app, py2exe and similar tools will gather everything that the application needs at runtime into a single bundle, with options you can somewhat control how those things are organized. Sometimes you need to help it a bit to include things that it misses, or to not include some things that it shouldn't, but the tool will do most of the heavy lifting for you. For Macs py2app organizes it into a .app bundle that the user normally sees as if it was a single file, and can simply drag it out of your disk image and into their applications folder or wherever they would like to put it. There is usually no need to make an Installer package for it unless you need to do something like install or change system files or run a script that modifies things outside of the application bundle. For Windows py2xe makes a folder full of files and you can use InnoSetup or similar to bundle together the files into the typical self-installer executable. Robin Dunn - wxPython thread