Skip to content

Commit

Permalink
Remove Jinja2 checks since it is already an explicit dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodegard committed Sep 18, 2024
1 parent adfdc2a commit 2c8b5c9
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions conda_build/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from os.path import isdir, isfile, join
from typing import TYPE_CHECKING, NamedTuple, overload

import jinja2
import yaml
from bs4 import UnicodeDammit
from conda.base.context import locate_prefix_by_name
Expand All @@ -30,7 +31,6 @@
DependencyNeedsBuildingError,
RecipeError,
UnableToParse,
UnableToParseMissingJinja2,
)
from .features import feature_list
from .license_family import ensure_valid_license_family
Expand Down Expand Up @@ -358,13 +358,6 @@ def yamlize(data):
try:
return yaml.load(data, Loader=StringifyNumbersLoader)
except yaml.error.YAMLError as e:
if "{{" in data:
try:
import jinja2

jinja2 # Avoid pyflakes failure: 'jinja2' imported but unused
except ImportError:
raise UnableToParseMissingJinja2(original=e)
print("Problematic recipe:", file=sys.stderr)
print(data, file=sys.stderr)
raise UnableToParse(original=e)
Expand Down Expand Up @@ -1918,17 +1911,6 @@ def _get_contents(
permit_undefined_jinja: If True, *any* use of undefined jinja variables will
evaluate to an emtpy string, without emitting an error.
"""
try:
import jinja2
except ImportError:
print("There was an error importing jinja2.", file=sys.stderr)
print(
"Please run `conda install jinja2` to enable jinja template support",
file=sys.stderr,
) # noqa
with open(self.meta_path) as fd:
return fd.read()

from .jinja_context import (
FilteredLoader,
UndefinedNeverFail,
Expand Down

0 comments on commit 2c8b5c9

Please sign in to comment.