Commit 1add5efd authored by Kirill Smelkov's avatar Kirill Smelkov

pygolang: Provide python-interpreter:exe

During my recent work I needed to use path for generated interpreter in
several places and found the need to repeat
${buildout:bin-directory}/${python-interpreter:interpreter} both tiring
and error-prone, because the knowledge where executable is placed
is implicitly used and relied upon.

On the other hand:

- pygolang already provides ${gpython:exe} as reference to the place
  where gpython is installed (see e1d269b4)

- pygolang already uses :exe for interpreter generated to accompany
  pyprog (see 0ee52376 and e328aa49)

So python-interpreter not providing :exe is an oversight and the logical
fix is to start providing python-interpreter:exe as well.

-> Do it and convert */software.cfg throughout the tree, where
python-interpreter is found, to use it.

/cc @jerome, @Tyagov, @alain.takoudjou, @xavier_thompson, @levin.zimmermann
/reviewed-on nexedi/slapos!1456
parent 351fb379
......@@ -30,6 +30,8 @@ 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:exe} is where buildout installs the interpreter.
[python-interpreter]
recipe = zc.recipe.egg:scripts
eggs = ${pygolang:egg}
......@@ -47,6 +49,7 @@ initialization =
# NOTE with scripts=ø interpreter is not handled, so we use `scripts=python` as
# a workaround.
scripts = ${:interpreter}
exe = ${buildout:bin-directory}/${:interpreter}
# pyprog provides macro recipe to build python programs.
......@@ -102,7 +105,6 @@ init =
<= python-interpreter
eggs += %(eggs)s
interpreter = $${:_buildout_section_name_}
exe = $${buildout:bin-directory}/$${:interpreter}
""" % locals())
......
......@@ -113,7 +113,7 @@ url = ${:_profile_base_location_}/${:filename}
recipe = slapos.recipe.template:jinja2
output = ${buildout:directory}/instance.cfg
url = ${:_profile_base_location_}/${:filename}
python-bin = ${buildout:bin-directory}/${python-interpreter:interpreter}
python-bin = ${python-interpreter:exe}
type = beremiz
context =
key autoconf_location autoconf:location
......
......@@ -138,7 +138,7 @@ needs-these-eggs-scripts-in-path =
[python-for-buildout-languageserver]
<= python-interpreter
interpreter = ${:_buildout_section_name_}
executable = ${buildout:bin-directory}/${:interpreter}
executable = ${:exe}
eggs +=
zc.buildout.languageserver
......
......@@ -230,7 +230,7 @@ context =
key unixodbc_location unixodbc:location
key wget_location wget:location
key extra_path_list eggs:extra-paths
key python_executable_for_kernel erp5-python-interpreter-jupyter:interpreter_path
key python_executable_for_kernel erp5-python-interpreter-jupyter:exe
key erp5_kernel_location erp5-kernel:location
key erp5_kernel_filename erp5-kernel:filename
key kernel_json_location kernel-json:location
......@@ -493,7 +493,6 @@ extra-paths += ${eggs:extra-paths}
[erp5-python-interpreter-jupyter]
<= erp5-python-interpreter
interpreter = pythonwitheggs_jupyter
interpreter_path = ${buildout:directory}/bin/${:interpreter}
eggs +=
jupyter_client
jupyter_core
......
......@@ -232,7 +232,7 @@ context =
key unixodbc_location unixodbc:location
key wget_location wget:location
key extra_path_list eggs:extra-paths
key python_executable_for_kernel erp5-python-interpreter-jupyter:interpreter_path
key python_executable_for_kernel erp5-python-interpreter-jupyter:exe
key erp5_kernel_location erp5-kernel:location
key erp5_kernel_filename erp5-kernel:filename
key kernel_json_location kernel-json:location
......@@ -495,7 +495,6 @@ extra-paths += ${eggs:extra-paths}
[erp5-python-interpreter-jupyter]
<= erp5-python-interpreter
interpreter = pythonwitheggs_jupyter
interpreter_path = ${buildout:directory}/bin/${:interpreter}
eggs +=
jupyter_client
jupyter_core
......
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