lcosmin/buildout.recipe.uwsgi — pull request #10 by amotl (2013-05-06 19:50:49+00:00)
Title: add option "pythonpath-eggs-directory" ...

... to tweak base directory of generated pythonpath configuration directives.

### Problem
For building RPMs we rely on ``relative-paths = true`` of ``zc.recipe.egg``. This is essential for us, since the CPack based building process will run in an arbitrary named temporary folder each time. Nonetheless uwsgi will require absolute path names for operation.

### Solution
Introduce an option ``pythonpath-eggs-directory`` which allows to set the prefix to a different eggs directory, which usually will be known from a custom buildout option when building for production.

Implementation:

if 'pythonpath-eggs-directory' in self.options:
source = self.options['eggs-directory']
target = self.options['pythonpath-eggs-directory']
pythonpaths = [path.replace(source, target) for path in pythonpaths]

Usage - buildout.cfg:

[uwsgi]
pythonpath-eggs-directory = /opt/vendor/product/python/eggs

Given this directory must be known in advance, we absolutely need this bit of control for driving our production builds.

Cheers,
Andreas.