diff options
author | David Lord <davidism@gmail.com> | 2020-01-26 21:12:47 -0800 |
---|---|---|
committer | David Lord <davidism@gmail.com> | 2020-01-26 21:12:47 -0800 |
commit | 4ec93a454b9b0a95f3772d56ebdac25702268f68 (patch) | |
tree | 6e49647d2c9ae2d1df6e2991da8afab75548df16 | |
parent | 8d85f9cb6b7617e62cc07dcd7f022b10027b5dab (diff) | |
download | jinja-4ec93a454b9b0a95f3772d56ebdac25702268f68.tar.gz |
Revert "add warning and alias for jinja2"
This reverts commit fc9c60ba457efc4cadf6fa2886567e0ee6ca1a99.
-rw-r--r-- | MANIFEST.in | 1 | ||||
-rw-r--r-- | setup.py | 3 | ||||
-rw-r--r-- | src/jinja/__init__.py | 2 | ||||
-rw-r--r-- | src/jinja/compiler.py | 2 | ||||
-rw-r--r-- | src/jinja/defaults.py | 3 | ||||
-rw-r--r-- | src/jinja/runtime.py | 10 | ||||
-rw-r--r-- | tests/test_bytecode_cache.py | 6 |
7 files changed, 15 insertions, 12 deletions
diff --git a/MANIFEST.in b/MANIFEST.in index bf028256..8cae0c74 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,4 +5,3 @@ prune docs/_build graft examples graft ext graft tests -global-exclude *.pyc @@ -20,6 +20,8 @@ setup( "Issue tracker": "https://github.com/pallets/jinja/issues", }, license="BSD-3-Clause", + author="Armin Ronacher", + author_email="armin.ronacher@active-4.com", maintainer="Pallets", maintainer_email="contact@palletsprojects.com", description="A very fast and expressive template engine.", @@ -37,7 +39,6 @@ setup( "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", diff --git a/src/jinja/__init__.py b/src/jinja/__init__.py index d758a5b0..9c4c9cfc 100644 --- a/src/jinja/__init__.py +++ b/src/jinja/__init__.py @@ -40,4 +40,4 @@ from .utils import is_undefined from .utils import Markup from .utils import select_autoescape -__version__ = "2.11.0rc1" +__version__ = "2.11.0.dev0" diff --git a/src/jinja/compiler.py b/src/jinja/compiler.py index f52d788f..88b4988b 100644 --- a/src/jinja/compiler.py +++ b/src/jinja/compiler.py @@ -712,7 +712,7 @@ class CodeGenerator(NodeVisitor): assert frame is None, "no root frame allowed" eval_ctx = EvalContext(self.environment, self.name) - from .runtime import exported + from .runtime import __all__ as exported self.writeline("from __future__ import %s" % ", ".join(code_features)) self.writeline("from jinja.runtime import " + ", ".join(exported)) diff --git a/src/jinja/defaults.py b/src/jinja/defaults.py index 8e0e7d77..b5d5f4ef 100644 --- a/src/jinja/defaults.py +++ b/src/jinja/defaults.py @@ -42,3 +42,6 @@ DEFAULT_POLICIES = { "json.dumps_kwargs": {"sort_keys": True}, "ext.i18n.trimmed": False, } + +# export all constants +__all__ = tuple(x for x in locals().keys() if x.isupper()) diff --git a/src/jinja/runtime.py b/src/jinja/runtime.py index d178e41e..f6d58a61 100644 --- a/src/jinja/runtime.py +++ b/src/jinja/runtime.py @@ -4,7 +4,7 @@ import sys from itertools import chain from types import MethodType -from markupsafe import escape # noqa: F401 +from markupsafe import escape from markupsafe import Markup from markupsafe import soft_unicode @@ -17,19 +17,19 @@ from ._compat import PY2 from ._compat import string_types from ._compat import text_type from ._compat import with_metaclass -from .exceptions import TemplateNotFound # noqa: F401 -from .exceptions import TemplateRuntimeError # noqa: F401 +from .exceptions import TemplateNotFound +from .exceptions import TemplateRuntimeError from .exceptions import UndefinedError from .nodes import EvalContext from .utils import concat from .utils import evalcontextfunction from .utils import internalcode from .utils import missing -from .utils import Namespace # noqa: F401 +from .utils import Namespace from .utils import object_type_repr # these variables are exported to the template runtime -exported = [ +__all__ = [ "LoopContext", "TemplateReference", "Macro", diff --git a/tests/test_bytecode_cache.py b/tests/test_bytecode_cache.py index 51c2dcb5..6a6173a0 100644 --- a/tests/test_bytecode_cache.py +++ b/tests/test_bytecode_cache.py @@ -9,9 +9,9 @@ from jinja.exceptions import TemplateNotFound @pytest.fixture -def env(package_loader, tmp_path): - bytecode_cache = FileSystemBytecodeCache(str(tmp_path)) - return Environment(loader=package_loader, bytecode_cache=bytecode_cache) +def env(package_loader): + bytecode_cache = FileSystemBytecodeCache() + return Environment(loader=package_loader, bytecode_cache=bytecode_cache,) @pytest.mark.byte_code_cache |