Commit ded78d04 authored by Xavier Thompson's avatar Xavier Thompson

component/macros: Simplify pythonpath macro

parent f38eda19
......@@ -3,22 +3,14 @@ parts =
[macro.pythonpath.eggs]
recipe = slapos.recipe.build
_name_ = ${:_buildout_section_name_}
init =
prerequisite = """
[.%(_name_)s.prerequisite]
recipe = slapos.recipe.build
init =
section = self.buildout['%(_name_)s']
self.eggs = [e.strip() for e in section['eggs'].splitlines() if e.strip()]
update =
self.eggs = [e.strip() for e in options['eggs'].splitlines() if e.strip()]
update =
from zc.buildout.easy_install import working_set
buildout = self.buildout['buildout']
eggs_directory = buildout['eggs-directory']
develop_eggs_directory = buildout['develop-eggs-directory']
dists = working_set(self.eggs, [develop_eggs_directory, eggs_directory])
paths = ':'.join(dist.location for dist in dists)
self.buildout['%(environment)s']['PYTHONPATH'] = paths
self.buildout[options['environment']]['PYTHONPATH'] = paths
print("PYTHONPATH=" + paths)
""" % options
self.buildout.parse(prerequisite)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment