# SlapOS component for pygolang.
# pygolang.nexedi.com

[buildout]
extends =
    ../../component/cython/buildout.cfg

parts =
    pygolang
    gpython


# pygolang installed from released egg from pypi
[pygolang]
recipe  = zc.recipe.egg:custom
egg     = pygolang
setup-eggs =
    ${cython:egg}
    setuptools-dso
    gevent

# gpython program
[gpython]
recipe  = zc.recipe.egg:scripts
eggs    = ${pygolang:egg}
scripts = gpython
# convenience for gpython users
exe     = ${buildout:bin-directory}/gpython

# python-interpreter provides python interpreter with all specified eggs.
# eggs default to pygolang, but can be overwritten or changed in inherited section.
# if eggs are changes, they must still have pygolang.
[python-interpreter]
recipe = zc.recipe.egg:scripts
eggs   = ${pygolang:egg}
interpreter = python
# interpreter code that buildout generates cannot process `-m pytest --<pytest-option>`
# -> use pymain from gpython to workaround that.
initialization =
  # tail to pymain
  from gpython import pymain
  pymain(sys.argv)
  sys.exit(0)
# don't install scripts from listed eggs (avoid conflict with other sections
# that use zc.recipe.egg with eggs overlapping with ${:eggs} - ex neoppod)
# (we cannot use zc.recipe.egg:eggs because interpreter does not work there)
# NOTE with scripts=ø interpreter is not handled, so we use `scripts=python` as
# a workaround.
scripts = ${:interpreter}


[versions]
pygolang = 0.0.8
