Traceback (most recent call last):
File "/Users/ytausch/autotickbot/conda-build/conda_build/metadata.py", line 2010, in _get_contents
rendered = template.render(environment=env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/cf-scripts/envs/cf-scripts/lib/python3.11/site-packages/jinja2/environment.py", line 1301, in render
self.environment.handle_exception()
File "/opt/homebrew/Caskroom/miniforge/base/envs/cf-scripts/envs/cf-scripts/lib/python3.11/site-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File "<template>", line 7, in top-level template code
jinja2.exceptions.UndefinedError: 'PYTHON' is undefined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/ytausch/autotickbot/conda-build/conda_build/build.py", line 3709, in build_tree
packages_from_this = build(
^^^^^^
File "/Users/ytausch/autotickbot/conda-build/conda_build/build.py", line 2335, in build
output_metas = expand_outputs([(m, need_source_download, need_reparse_in_env)])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ytausch/autotickbot/conda-build/conda_build/render.py", line 916, in expand_outputs
for output_dict, m in deepcopy(_m).get_output_metadata_set(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ytausch/autotickbot/conda-build/conda_build/metadata.py", line 2658, in get_output_metadata_set
conda_packages = finalize_outputs_pass(
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ytausch/autotickbot/conda-build/conda_build/metadata.py", line 1025, in finalize_outputs_pass
fm = finalize_metadata(
^^^^^^^^^^^^^^^^^^
File "/Users/ytausch/autotickbot/conda-build/conda_build/render.py", line 649, in finalize_metadata
m = parent_metadata.get_output_metadata(m.get_rendered_output(m.name()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ytausch/autotickbot/conda-build/conda_build/metadata.py", line 2743, in get_rendered_output
for output_ in self.get_rendered_outputs_section(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ytausch/autotickbot/conda-build/conda_build/metadata.py", line 2725, in get_rendered_outputs_section
self._get_contents(
File "/Users/ytausch/autotickbot/conda-build/conda_build/metadata.py", line 2020, in _get_contents
raise CondaBuildUserError(
conda_build.exceptions.CondaBuildUserError: Failed to render jinja template in :
'PYTHON' is undefined
Checklist
What happened?
Consider the following recipe:
I don't see why this recipe should not be able to be built.
However, conda build fails with
Error: Failed to render jinja template in /home/conda/recipe_root/meta.yaml: 'PYTHON' is undefinedApparently, this happens because the entire jinja template is rendered for every output but
PYTHONis only set if the currently-processed output has Python as a host dependency.I think a better behavior would be to strip out details about other outputs including the variables they reference before rendering with patched metadata dependent on individual outputs.
Details
Conda Info
No response
Conda Config
No response
Conda list
No response
Additional Context
No response