Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3 regression: Undefined Jinja2 variables get rendered as empty string in linting #1726

Closed
1 task done
zklaus opened this issue Mar 24, 2023 · 0 comments · Fixed by #1727
Closed
1 task done
Labels

Comments

@zklaus
Copy link

zklaus commented Mar 24, 2023

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

For linting, undefined Jinja2 variables get rendered by conda_smithy.utils.NullUndefined. That class contains a __unicode__ method that returns the name of the variable. This is useful to put a clear placeholder where variables will be filled by variants from conda_build_config.yaml during the actual build. However, NullUndefined doesn't overwrite the __str__ method of Jinja's own Undefined, which returns an empty string.

In effect, linting in a Python 2 environment renders, e.g. - {{ libjpeg }} as - libjpeg, but in a Python 3 environment, we get - which becomes None in the requirements_section dictionary.

Installed packages

-

Environment info

-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant