Commit 7b27f510 authored by Jérome Perrin's avatar Jérome Perrin

Merge branch 'y/zope4py3+gpy' of https://lab.nexedi.com/kirr/slapos into zope4py3

parents 8c52d438 77d1bbdb
Pipeline #34392 failed with stage
in 0 seconds
...@@ -8,7 +8,7 @@ extends = ...@@ -8,7 +8,7 @@ extends =
parts = parts =
pygolang pygolang
gpython gpython-interpreter
# pygolang is installed from git checkout # pygolang is installed from git checkout
...@@ -21,19 +21,11 @@ setup-eggs = ...@@ -21,19 +21,11 @@ setup-eggs =
setuptools-dso setuptools-dso
gevent gevent
# gpython program
[gpython]
recipe = zc.recipe.egg:scripts
eggs = ${pygolang:egg}
scripts = gpython
# convenience for gpython users
exe = ${buildout:bin-directory}/gpython
[pygolang-repository] [pygolang-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/pygolang.git repository = https://lab.nexedi.com/kirr/pygolang.git
branch = master branch = y/bstr+x/gpystr
revision = pygolang-0.1-69-g044deb35 #revision = pygolang-0.1-69-g044deb35
location = ${buildout:parts-directory}/pygolang location = ${buildout:parts-directory}/pygolang
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
...@@ -49,7 +41,9 @@ eggs = ${pygolang:egg} ...@@ -49,7 +41,9 @@ eggs = ${pygolang:egg}
interpreter = python interpreter = python
# interpreter code that buildout generates cannot process `-m pytest --<pytest-option>` # interpreter code that buildout generates cannot process `-m pytest --<pytest-option>`
# -> use pymain from gpython to workaround that. # -> use pymain from gpython to workaround that.
pre-initialization =
initialization = initialization =
${:pre-initialization}
# tail to pymain # tail to pymain
from gpython import pymain from gpython import pymain
pymain(sys.argv) pymain(sys.argv)
...@@ -63,6 +57,17 @@ scripts = ${:interpreter} ...@@ -63,6 +57,17 @@ scripts = ${:interpreter}
exe = ${buildout:bin-directory}/${:interpreter} exe = ${buildout:bin-directory}/${:interpreter}
# gpython-interpreter is like python-interpreter, but runs gpython instead of standard python.
[gpython-interpreter]
<= python-interpreter
interpreter = gpython
initialization =
${:pre-initialization}
from gpython import main
main()
sys.exit(0)
# pyprog provides macro recipe to build python programs. # pyprog provides macro recipe to build python programs.
# #
# Contrary to zc.recipe.egg:scripts it generates scripts that are run with # Contrary to zc.recipe.egg:scripts it generates scripts that are run with
...@@ -77,6 +82,13 @@ exe = ${buildout:bin-directory}/${:interpreter} ...@@ -77,6 +82,13 @@ exe = ${buildout:bin-directory}/${:interpreter}
# exe = ${buildout:bin-directory}/myprog # exe = ${buildout:bin-directory}/myprog
# entry = my.py.mod:main # entry = my.py.mod:main
# eggs = ... # eggs = ...
#
# By default python interpreter defined in [python-interpreter] section is used
# to run the program. The default can be adjusted as illustrated below:
#
# [myprog]
# <= pyprog
# python-interpreter = gpython-interpreter # set to name of the section that defines the interpreter
[pyprog] [pyprog]
recipe = slapos.recipe.build recipe = slapos.recipe.build
initialization = initialization =
...@@ -88,6 +100,7 @@ init = ...@@ -88,6 +100,7 @@ init =
entry = options['entry'] entry = options['entry']
eggs = options['eggs'] eggs = options['eggs']
pyinit = options['initialization'] pyinit = options['initialization']
pyinterpreter = options.get('python-interpreter', 'python-interpreter')
options['depends'] += '$${.%s.pyprog:recipe}' % name options['depends'] += '$${.%s.pyprog:recipe}' % name
...@@ -97,6 +110,7 @@ init = ...@@ -97,6 +110,7 @@ init =
# indent pyinit with ' ' # indent pyinit with ' '
__pyinit = '\n'.join([' '+_ for _ in pyinit.splitlines()]) __pyinit = '\n'.join([' '+_ for _ in pyinit.splitlines()])
__eggs = '\n'.join([' '+_ for _ in eggs.splitlines()])
self.buildout.parse(""" self.buildout.parse("""
# .X.pyprog is python program to start and run entry # .X.pyprog is python program to start and run entry
...@@ -113,7 +127,7 @@ init = ...@@ -113,7 +127,7 @@ init =
# .X.pyexe is python interpreter used by .X.pyprog # .X.pyexe is python interpreter used by .X.pyprog
[.%(name)s.pyexe] [.%(name)s.pyexe]
<= python-interpreter <= %(pyinterpreter)s
eggs += %(eggs)s eggs += %(__eggs)s
interpreter = $${:_buildout_section_name_} interpreter = $${:_buildout_section_name_}
""" % locals()) """ % locals())
...@@ -88,6 +88,7 @@ parts += ...@@ -88,6 +88,7 @@ parts +=
# some additional utils # some additional utils
zodbpack zodbpack
runwsgi
# Create instance template # Create instance template
template template
...@@ -505,12 +506,28 @@ initialization = ...@@ -505,12 +506,28 @@ initialization =
sys.path[0:0] = ['/'.join(['''${buildout:parts-directory}''', x]) for x in repository_id_list] sys.path[0:0] = ['/'.join(['''${buildout:parts-directory}''', x]) for x in repository_id_list]
[erp5-python-interpreter] [erp5-python-interpreter]
<= python-interpreter
# a python interpreter with all eggs available, usable for the software release but also # a python interpreter with all eggs available, usable for the software release but also
# for external tools (such as python extension in theia). # for external tools (such as python extension in theia).
# we also want to use bstr/ustr from gpython as builtin string types, but keep
# the program named as just `python`.
<= gpython-interpreter
interpreter = python
pre-initialization +=
import os
os.environ.setdefault('GPYTHON_STRINGS', 'bstr+ustr')
os.environ.setdefault('GPYTHON_RUNTIME', 'threads')
eggs += ${eggs:eggs} eggs += ${eggs:eggs}
extra-paths += ${eggs:extra-paths} extra-paths += ${eggs:extra-paths}
# erp5-pyprog is similar to pyprog macro and should be used by python-based
# programs instantiated in ERP5 software-release.
[erp5-pyprog]
<= pyprog
exe = ${buildout:bin-directory}/${:_buildout_section_name_}
python-interpreter = erp5-python-interpreter
# by default no need for extra eggs in addition to eggs provided by interpreter
eggs =
[erp5-python-interpreter-jupyter] [erp5-python-interpreter-jupyter]
<= erp5-python-interpreter <= erp5-python-interpreter
interpreter = pythonwitheggs_jupyter interpreter = pythonwitheggs_jupyter
...@@ -662,11 +679,9 @@ eggs = ...@@ -662,11 +679,9 @@ eggs =
Zope Zope
entry-points = entry-points =
runwsgi=Products.ERP5.bin.zopewsgi:runwsgi
scripts = scripts =
apachedex apachedex
performance_tester_erp5 performance_tester_erp5
runwsgi
runzeo runzeo
tidstoraged tidstoraged
tidstorage_repozo tidstorage_repozo
...@@ -783,6 +798,11 @@ scripts = ...@@ -783,6 +798,11 @@ scripts =
depends = depends =
${slapos-toolbox-dependencies:eggs} ${slapos-toolbox-dependencies:eggs}
[runwsgi]
<= erp5-pyprog
entry = Products.ERP5.bin.zopewsgi:runwsgi
[versions] [versions]
# See ../../software/neoppod/software-common.cfg for versions common with NEO: # See ../../software/neoppod/software-common.cfg for versions common with NEO:
# neoppod, mysqlclient, slapos.recipe.template # neoppod, mysqlclient, slapos.recipe.template
......
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