Question

I'm unsure whether to use the CherryPy download from the official site, or the version found in my distro's package manager.

If I use the official download, portability will be less of an issue if I need to move between a dev environment and a live environment, and I'm guaranteed the same version on both systems. On the other hand, if I let my distro's package manager handle it, then I won't have to worry about keeping CherryPy updated and I also won't need to keep it in source control. Another potential downside of allowing my package manager to handle updates is that there is generally quite a delay between an official software release and the software finding its way into the repos.

What is the accepted practice for this?

Was it helpful?

Solution

for each python project that i work on i create a file called setup-env.sh which builds a local virtual environment. this is included with the source. for example, in a recent project:

#!/bin/bash

virtualenv --python=python3.2 env
source env/bin/activate
easy_install cherrypy
easy_install pytache
easy_install sql_alchemy
easy_install stagger
easy_install nose
easy_install pystache

this creates an environment that is unique to the project, which contains the latest stable releases, and which is easy to reproduce.

before working on the project do:

source env/bin/activate

to modify your PATH and PYTHONPATH correctly.

if you do not have easy_install available you need to install the distutils package or similar.

this is the best solution because:

  • you get to use recent stable versions rather than whatever the distro packaged
  • you use a minimal, documented set of packages (you don't 'accidentally' use a package installed for another project)
  • it's easy to recreate on another machine
  • it's easy to recreate if you update your distro
  • it's easy to extend to specify particular version numbers (easy_install cherrypy==3.2.0)
  • it's easy to specify a particular python version

OTHER TIPS

As you use gentoo, I would use a custom overlay that is shared between the servers and your workstation. (see http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3&chap=5)

In your overlay, if you need a more recent version of cherrypy, you can always bump it in there and install it on your workstation then when it is time to upgrade, unmask it from your servers.

As it is your overlay you don't need to wait for an official packaging. Either you adapt the ebuild yourself (usually 90% of the time it is just a matter of renaming it to bump the version) or you can copy it from more advanced overlays on your subject like the python overlay (which is now named progress) http://code.google.com/p/gentoo-progress/ for your example.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top