From 2c1018a7cb349eb23ccd34c2c095cc4c85de7ed11e0d44303bc4ab29bf032bf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BAkup?= Date: Tue, 18 Feb 2020 17:34:49 +0000 Subject: [PATCH] =?UTF-8?q?-=20update=20to=202.11.1=20=20*=20Fix=20a=20bug?= =?UTF-8?q?=20that=20prevented=20looking=20up=20a=20key=20after=20an=20att?= =?UTF-8?q?ribute=20=20=20=20({{=20data.items[1:]=20}})=20in=20an=20async?= =?UTF-8?q?=20template=20=20*=20Drop=20support=20for=20Python=202.6,=203.3?= =?UTF-8?q?,=20and=203.4.=20This=20will=20be=20the=20last=20version=20=20?= =?UTF-8?q?=20=20to=20support=20Python=202.7=20and=203.5.=20=20*=20Added?= =?UTF-8?q?=20a=20new=20ChainableUndefined=20class=20to=20support=20getite?= =?UTF-8?q?m=20and=20getattr=20=20=20=20on=20an=20undefined=20object.=20?= =?UTF-8?q?=20*=20Allow=20{%+=20syntax=20(with=20NOP=20behavior)=20when=20?= =?UTF-8?q?lstrip=5Fblocks=20is=20disabled.=20=20*=20Added=20a=20default?= =?UTF-8?q?=20parameter=20for=20the=20map=20filter.=20=20*=20Exclude=20env?= =?UTF-8?q?ironment=20globals=20from=20meta.find=5Fundeclared=5Fvariables(?= =?UTF-8?q?).=20=20*=20Float=20literals=20can=20be=20written=20with=20scie?= =?UTF-8?q?ntific=20notation,=20like=202.56e-3.=20=20*=20Int=20and=20float?= =?UTF-8?q?=20literals=20can=20be=20written=20with=20the=20=E2=80=98=5F?= =?UTF-8?q?=E2=80=99=20separator=20=20=20=20for=20legibility,=20like=2012?= =?UTF-8?q?=5F345.=20=20*=20Fix=20a=20bug=20causing=20deadlocks=20in=20LRU?= =?UTF-8?q?Cache.setdefault=20=20*=20The=20trim=20filter=20takes=20an=20op?= =?UTF-8?q?tional=20string=20of=20characters=20to=20trim.=20=20*=20A=20new?= =?UTF-8?q?=20jinja2.ext.debug=20extension=20adds=20a=20{%=20debug=20%}=20?= =?UTF-8?q?tag=20to=20quickly=20dump=20=20=20=20the=20current=20context=20?= =?UTF-8?q?and=20available=20filters=20and=20tests.=20=20*=20Lexing=20temp?= =?UTF-8?q?lates=20with=20large=20amounts=20of=20whitespace=20is=20much=20?= =?UTF-8?q?faster.=20=20*=20Parentheses=20around=20comparisons=20are=20pre?= =?UTF-8?q?served,=20so=20{{=202=20*=20(3=20<=205)=20}}=20outputs=20=20=20?= =?UTF-8?q?=20=E2=80=9C2=E2=80=9D=20instead=20of=20=E2=80=9CFalse=E2=80=9D?= =?UTF-8?q?.=20=20*=20Add=20new=20boolean,=20false,=20true,=20integer=20an?= =?UTF-8?q?d=20float=20tests.=20=20*=20The=20environment=C3=A2=E2=82=AC?= =?UTF-8?q?=E2=84=A2s=20finalize=20function=20is=20only=20applied=20to=20t?= =?UTF-8?q?he=20output=20of=20expressions=20=20=20=20(constant=20or=20not)?= =?UTF-8?q?,=20not=20static=20template=20data.=20=20*=20When=20providing?= =?UTF-8?q?=20multiple=20paths=20to=20FileSystemLoader,=20a=20template=20c?= =?UTF-8?q?an=20have=20=20=20=20the=20same=20name=20as=20a=20directory.=20?= =?UTF-8?q?=20*=20Always=20return=20Undefined=20when=20omitting=20the=20el?= =?UTF-8?q?se=20clause=20in=20a=20{{=20'foo'=20if=20bar=20}}=20=20=20=20ex?= =?UTF-8?q?pression,=20regardless=20of=20the=20environment=C3=A2=E2=82=AC?= =?UTF-8?q?=E2=84=A2s=20undefined=20class.=20Omitting=20=20=20=20the=20els?= =?UTF-8?q?e=20clause=20is=20a=20valid=20shortcut=20and=20should=20not=20r?= =?UTF-8?q?aise=20an=20error=20when=20using=20=20=20=20StrictUndefined.=20?= =?UTF-8?q?=20*=20Fix=20behavior=20of=20loop=20control=20variables=20such?= =?UTF-8?q?=20as=20length=20and=20revindex0=20when?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Jinja2?expand=0&rev=76 --- Jinja2-2.10.3.tar.gz | 3 -- Jinja2-2.11.1.tar.gz | 3 ++ python-Jinja2.changes | 72 +++++++++++++++++++++++++++++++++++++++++++ python-Jinja2.spec | 19 ++---------- 4 files changed, 77 insertions(+), 20 deletions(-) delete mode 100644 Jinja2-2.10.3.tar.gz create mode 100644 Jinja2-2.11.1.tar.gz diff --git a/Jinja2-2.10.3.tar.gz b/Jinja2-2.10.3.tar.gz deleted file mode 100644 index dc2266c..0000000 --- a/Jinja2-2.10.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9fe95f19286cfefaa917656583d020be14e7859c6b0252588391e47db34527de -size 257888 diff --git a/Jinja2-2.11.1.tar.gz b/Jinja2-2.11.1.tar.gz new file mode 100644 index 0000000..ccf186c --- /dev/null +++ b/Jinja2-2.11.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93187ffbc7808079673ef52771baa950426fd664d3aad1d0fa3e95644360e250 +size 258043 diff --git a/python-Jinja2.changes b/python-Jinja2.changes index c9ce94f..e01b3a4 100644 --- a/python-Jinja2.changes +++ b/python-Jinja2.changes @@ -1,3 +1,75 @@ +------------------------------------------------------------------- +Tue Feb 18 17:26:13 UTC 2020 - Ondřej Súkup + +- update to 2.11.1 + * Fix a bug that prevented looking up a key after an attribute + ({{ data.items[1:] }}) in an async template + * Drop support for Python 2.6, 3.3, and 3.4. This will be the last version + to support Python 2.7 and 3.5. + * Added a new ChainableUndefined class to support getitem and getattr + on an undefined object. + * Allow {%+ syntax (with NOP behavior) when lstrip_blocks is disabled. + * Added a default parameter for the map filter. + * Exclude environment globals from meta.find_undeclared_variables(). + * Float literals can be written with scientific notation, like 2.56e-3. + * Int and float literals can be written with the ‘_’ separator + for legibility, like 12_345. + * Fix a bug causing deadlocks in LRUCache.setdefault + * The trim filter takes an optional string of characters to trim. + * A new jinja2.ext.debug extension adds a {% debug %} tag to quickly dump + the current context and available filters and tests. + * Lexing templates with large amounts of whitespace is much faster. + * Parentheses around comparisons are preserved, so {{ 2 * (3 < 5) }} outputs + “2” instead of “False”. + * Add new boolean, false, true, integer and float tests. + * The environment’s finalize function is only applied to the output of expressions + (constant or not), not static template data. + * When providing multiple paths to FileSystemLoader, a template can have + the same name as a directory. + * Always return Undefined when omitting the else clause in a {{ 'foo' if bar }} + expression, regardless of the environment’s undefined class. Omitting + the else clause is a valid shortcut and should not raise an error when using + StrictUndefined. + * Fix behavior of loop control variables such as length and revindex0 when + looping over a generator. + * Async support is only loaded the first time an environment enables it, + in order to avoid a slow initial import. + * In async environments, the |map filter will await the filter call if needed. + * In for loops that access loop attributes, the iterator is not advanced ahead + of the current iteration unless length, revindex, nextitem, or last are accessed. + This makes it less likely to break groupby results. + * In async environments, the loop attributes length and revindex work for async iterators. + * In async environments, values from attribute/property access will be awaited if needed. + * PackageLoader doesn’t depend on setuptools or pkg_resources. + * PackageLoader has limited support for PEP 420 namespace packages. + * Support os.PathLike objects in FileSystemLoader and ModuleLoader + * NativeTemplate correctly handles quotes between expressions. "'{{ a }}', '{{ b }}'" + renders as the tuple ('1', '2') rather than the string '1, 2'. + * Creating a NativeTemplate directly creates a NativeEnvironment instead + of a default Environment. + * After calling LRUCache.copy(), the copy’s queue methods point to the correct queue. + * Compiling templates always writes UTF-8 instead of defaulting to the system encoding. + * |wordwrap filter treats existing newlines as separate paragraphs to be wrapped + individually, rather than creating short intermediate lines. + * Add break_on_hyphens parameter to |wordwrap filter. + * Cython compiled functions decorated as context functions will be passed the context. + * When chained comparisons of constants are evaluated at compile time, + the result follows Python’s behavior of returning False if any comparison + returns False, rather than only the last one + * Tracebacks for exceptions in templates show the correct line numbers + and source for Python >= 3.7. + * Tracebacks for template syntax errors in Python 3 no longer show + internal compiler frames + * Add a DerivedContextReference node that can be used by extensions to get + the current context and local variables such as loop + * Constant folding during compilation is applied to some node types + that were previously overlooked + * TemplateSyntaxError.source is not empty when raised from an included template. + * Passing an Undefined value to get_template (such as through extends, import, + or include), raises an UndefinedError consistently. select_template will show + the undefined message in the list of attempts rather than the empty string. + * TemplateSyntaxError can be pickled. + ------------------------------------------------------------------- Mon Oct 7 13:37:05 UTC 2019 - Tomáš Chvátal diff --git a/python-Jinja2.spec b/python-Jinja2.spec index 0c78b7e..1ae53d9 100644 --- a/python-Jinja2.spec +++ b/python-Jinja2.spec @@ -1,7 +1,7 @@ # # spec file for package python-Jinja2 # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define oldpython python Name: python-Jinja2 -Version: 2.10.3 +Version: 2.11.1 Release: 0 Summary: A template engine written in pure Python License: BSD-3-Clause @@ -47,7 +47,6 @@ sandboxed environment. %package -n python-Jinja2-vim Summary: Jinja2 syntax files for Vim -License: BSD-3-Clause Requires: %{name} = %{version} %if 0%{?suse_version} || 0%{?fedora_version} >= 24 Recommends: vim @@ -56,16 +55,6 @@ Recommends: vim %description -n python-Jinja2-vim Vim syntax highlighting scheme for Jinja2 templates. -%package -n python-Jinja2-emacs -Summary: Jinja2 syntax files for Emacs -License: GPL-2.0-or-later -Requires: %{name} = %{version} -%if 0%{?suse_version} || 0%{?fedora_version} >= 24 -Recommends: emacs -%endif - -%description -n python-Jinja2-emacs -Emacs syntax highlighting scheme for Jinja2 templates. %prep %setup -q -n Jinja2-%{version} @@ -77,7 +66,6 @@ dos2unix LICENSE.rst # Fix wrong EOL encoding %install %python_install install -Dm644 ext/Vim/jinja.vim %{buildroot}%{_datadir}/vim/site/syntax/jinja.vim # Install VIM syntax file -install -Dm644 ext/jinja.el %{buildroot}%{_datadir}/emacs/site-lisp/jinja.el # Install Emacs syntax file %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -95,7 +83,4 @@ install -Dm644 ext/jinja.el %{buildroot}%{_datadir}/emacs/site-lisp/jinja.el # I %dir %{_datadir}/vim/site/syntax %{_datadir}/vim/site/syntax/jinja.vim -%files -n python-Jinja2-emacs -%{_datadir}/emacs/site-lisp/jinja.el - %changelog