graft examples
graft ext
graft tests
+global-exclude *.pyc
--- /dev/null
+Copyright 2007 Pallets
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--- /dev/null
+global-exclude *.pyc
--- /dev/null
+The Jinja2 package has been renamed to `Jinja`_. This package provides
+compatibility while projects transition to the new name. Imports from
+``jinja2`` will be redirected to ``jinja`` and a deprecation warning
+will be emitted.
+
+Projects are advised to require 'Jinja' instead of 'Jinja2' and replace
+all imports of ``jinja2`` with ``jinja`` to continue receiving updates.
+
+.. _Jinja: https://pypi.org/project/Jinja/
--- /dev/null
+[metadata]
+license_file = LICENSE.rst
+
+[bdist_wheel]
+universal = true
--- /dev/null
+import io
+
+from setuptools import find_packages
+from setuptools import setup
+
+with io.open("README.rst", "rt", encoding="utf8") as f:
+ readme = f.read()
+
+setup(
+ name="Jinja2",
+ version="2.11.0rc1",
+ url="https://palletsprojects.com/p/jinja/",
+ project_urls={
+ "Documentation": "https://jinja.palletsprojects.com/",
+ "Code": "https://github.com/pallets/jinja",
+ "Issue tracker": "https://github.com/pallets/jinja/issues",
+ },
+ license="BSD-3-Clause",
+ maintainer="Pallets",
+ maintainer_email="contact@palletsprojects.com",
+ description=(
+ "A very fast and expressive template engine. Compatibility"
+ " package for Jinja2 to Jinja rename."
+ ),
+ long_description=readme,
+ classifiers=[
+ "Development Status :: 5 - Production/Stable",
+ "Environment :: Web Environment",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: BSD License",
+ "Operating System :: OS Independent",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 2",
+ "Programming Language :: Python :: 2.7",
+ "Programming Language :: Python :: 3",
+ "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",
+ "Topic :: Software Development :: Libraries :: Python Modules",
+ "Topic :: Text Processing :: Markup :: HTML",
+ ],
+ packages=find_packages("src"),
+ package_dir={"": "src"},
+ include_package_data=True,
+ python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
+ install_requires=["Jinja<4.0"],
+ extras_require={"i18n": ["Babel>=0.8"]},
+ entry_points={"babel.extractors": ["jinja2 = jinja2.ext:babel_extract[i18n]"]},
+)
--- /dev/null
+def _export_jinja(name, ns):
+ import warnings
+ from importlib import import_module
+
+ mod_name = "jinja" if not name else ("jinja." + name)
+ warnings.warn(
+ "'jinja2' has been renamed to 'jinja'. Import from %r instead." % mod_name,
+ DeprecationWarning,
+ stacklevel=3,
+ )
+ mod = import_module(mod_name)
+
+ for key, value in vars(mod).items():
+ if not key.startswith("__") or key == "__version__":
+ ns[key] = value
+
+ if name:
+ ns.pop("_export_jinja")
+
+
+_export_jinja(None, globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("_compat", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("_identifier", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("asyncfilters", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("asyncsupport", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("bccache", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("compiler", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("constants", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("debug", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("defaults", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("environment", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("exceptions", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("ext", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("filters", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("idtracking", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("lexer", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("loaders", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("meta", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("nativetypes", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("nodes", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("optimizer", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("parser", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("runtime", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("sandbox", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("tests", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("utils", globals())
--- /dev/null
+from . import _export_jinja
+
+_export_jinja("visitor", globals())
"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.",
"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",
from .utils import Markup
from .utils import select_autoescape
-__version__ = "2.11.0.dev0"
+__version__ = "2.11.0rc1"
assert frame is None, "no root frame allowed"
eval_ctx = EvalContext(self.environment, self.name)
- from .runtime import __all__ as exported
+ from .runtime import exported
self.writeline("from __future__ import %s" % ", ".join(code_features))
self.writeline("from jinja.runtime import " + ", ".join(exported))
"json.dumps_kwargs": {"sort_keys": True},
"ext.i18n.trimmed": False,
}
-
-# export all constants
-__all__ = tuple(x for x in locals().keys() if x.isupper())
from itertools import chain
from types import MethodType
-from markupsafe import escape
+from markupsafe import escape # noqa: F401
from markupsafe import Markup
from markupsafe import soft_unicode
from ._compat import string_types
from ._compat import text_type
from ._compat import with_metaclass
-from .exceptions import TemplateNotFound
-from .exceptions import TemplateRuntimeError
+from .exceptions import TemplateNotFound # noqa: F401
+from .exceptions import TemplateRuntimeError # noqa: F401
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
+from .utils import Namespace # noqa: F401
from .utils import object_type_repr
# these variables are exported to the template runtime
-__all__ = [
+exported = [
"LoopContext",
"TemplateReference",
"Macro",
@pytest.fixture
-def env(package_loader):
- bytecode_cache = FileSystemBytecodeCache()
- return Environment(loader=package_loader, bytecode_cache=bytecode_cache,)
+def env(package_loader, tmp_path):
+ bytecode_cache = FileSystemBytecodeCache(str(tmp_path))
+ return Environment(loader=package_loader, bytecode_cache=bytecode_cache)
@pytest.mark.byte_code_cache