Woltan
Woltan

Reputation: 14023

Best practice to install dependencies?

I am thinking of a good way to ship my application which is a python package. Installing my package is easy making use of pythons distutils package.

The trouble comes with the dependencies my package relies on. If the dependencies are python packages I can deal with them easily again using distutils, but non python packages? Some of them even need a lot of care while building and installing them since very special compiler flags need to be set and so forth...

If I want to automate the installation procedure for the user what is the best way to go about it?

  1. Writing a make file that downloads and installs the dependencies
  2. Write a script that installs the dependencies
  3. No automation is best. simply write a manual that tells the user how to install the dependencies
  4. ???

Thx in advance for any answer or suggestion

Upvotes: 5

Views: 3476

Answers (2)

tito
tito

Reputation: 13251

We have a project named Kivy ( http://kivy.org/ ), that have exactly the same issue. At the early stage, we've done a all-in-one package that include every setup of every dependencies. However the user was having a lot of "Next >" button to click... for every deps (Windows). So now, we have managed to take care ourself of the dependencies.

Except linux related (since all our deps are already packaged on "linux"), we have taken the approach of managing what we named "portable-deps" zipfile for each platform. And then, we have a script that:

  1. Download the portable-deps zip
  2. Include the latest version of our project
  3. Add launcher script in the root directory
  4. Zip the root directory, and rename the zip to project--.zip

With a special case for MacOSX, where the zip is a dmg with a little UI.

The good part is that the user don't have to care about deps, and developers know exactly what binaries are delivered with the project :)

For information, we have build_portable commands for distutils :

Upvotes: 5

David
David

Reputation: 326

The most important thing to help you decide is to consider your audience.

Are they technically-inclined and likely to be comfortable following instructions specifying how to build the dependencies themselves? If so, go with (3). If not, writing a python or shell script, or a makefile to automate the task may be the way to go. Pick whichever you feel most comfortable writing.

Upvotes: 4

Related Questions