Commit 2e3d9ec4 authored by Kirill Smelkov's avatar Kirill Smelkov

erp5: Switch from python-interpreter to gpython-interpreter

This is preparatory step to later use bstr/ustr from gpython as builtin string
types. For now we keep both runtime to be threads and string types to be
unpatched builtin types provided by python natively. This way there should be
practically no change in how ERP5 runs yet.

/cc @kazuhiko, @jerome
parent 59e64416
...@@ -41,7 +41,9 @@ eggs = ${pygolang:egg} ...@@ -41,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)
...@@ -60,6 +62,7 @@ exe = ${buildout:bin-directory}/${:interpreter} ...@@ -60,6 +62,7 @@ exe = ${buildout:bin-directory}/${:interpreter}
<= python-interpreter <= python-interpreter
interpreter = gpython interpreter = gpython
initialization = initialization =
${:pre-initialization}
from gpython import main from gpython import main
main() main()
sys.exit(0) sys.exit(0)
......
...@@ -463,9 +463,16 @@ initialization = ...@@ -463,9 +463,16 @@ 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 will 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', 'pystd') # TODO switch to bstr+ustr
os.environ.setdefault('GPYTHON_RUNTIME', 'threads')
eggs += ${eggs:eggs} eggs += ${eggs:eggs}
extra-paths += ${eggs:extra-paths} extra-paths += ${eggs:extra-paths}
......
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