Commit ded78d04 authored by Xavier Thompson's avatar Xavier Thompson

component/macros: Simplify pythonpath macro

parent f38eda19
...@@ -3,22 +3,14 @@ parts = ...@@ -3,22 +3,14 @@ parts =
[macro.pythonpath.eggs] [macro.pythonpath.eggs]
recipe = slapos.recipe.build recipe = slapos.recipe.build
_name_ = ${:_buildout_section_name_}
init = init =
prerequisite = """ self.eggs = [e.strip() for e in options['eggs'].splitlines() if e.strip()]
[.%(_name_)s.prerequisite] update =
recipe = slapos.recipe.build from zc.buildout.easy_install import working_set
init = buildout = self.buildout['buildout']
section = self.buildout['%(_name_)s'] eggs_directory = buildout['eggs-directory']
self.eggs = [e.strip() for e in section['eggs'].splitlines() if e.strip()] develop_eggs_directory = buildout['develop-eggs-directory']
update = dists = working_set(self.eggs, [develop_eggs_directory, eggs_directory])
from zc.buildout.easy_install import working_set paths = ':'.join(dist.location for dist in dists)
buildout = self.buildout['buildout'] self.buildout[options['environment']]['PYTHONPATH'] = paths
eggs_directory = buildout['eggs-directory'] print("PYTHONPATH=" + paths)
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
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