mirror of https://gitee.com/openkylin/jinja2.git
Import Debian changes 3.1.2-ok1
jinja2 (3.1.2-ok1) nile; urgency=medium * Build for openKylin.
This commit is contained in:
parent
65adae8035
commit
2792bae95c
|
@ -0,0 +1,5 @@
|
|||
jinja2 (3.1.2-ok1) nile; urgency=medium
|
||||
|
||||
* Build for openKylin.
|
||||
|
||||
-- openKylinBot <openKylinBot@openkylin.top> Tue, 07 May 2024 15:42:46 +0800
|
|
@ -0,0 +1,72 @@
|
|||
Source: jinja2
|
||||
Section: python
|
||||
Priority: optional
|
||||
Maintainer: openKylin Developers <packaging@lists.openkylin.top>
|
||||
XSBC-Original-Maintainer: Piotr Ożarowski <piotr@debian.org>
|
||||
Uploaders:
|
||||
Debian Python Team <team+python@tracker.debian.org>,
|
||||
Build-Depends:
|
||||
debhelper-compat (= 12),
|
||||
dh-python,
|
||||
python3-all,
|
||||
python3-babel,
|
||||
python3-markupsafe (>= 2.0),
|
||||
python3-pallets-sphinx-themes (>= 2.0.2),
|
||||
python3-pygments,
|
||||
python3-pytest,
|
||||
python3-setuptools,
|
||||
python3-sphinx,
|
||||
python3-sphinx-issues,
|
||||
Standards-Version: 4.5.0
|
||||
Homepage: http://jinja.pocoo.org/
|
||||
Vcs-Git: https://salsa.debian.org/python-team/packages/jinja2.git
|
||||
Vcs-Browser: https://salsa.debian.org/python-team/packages/jinja2
|
||||
|
||||
Package: python-jinja2-doc
|
||||
Section: doc
|
||||
Architecture: all
|
||||
Depends:
|
||||
${misc:Depends},
|
||||
${sphinxdoc:Depends},
|
||||
Recommends:
|
||||
python3-jinja2,
|
||||
Multi-Arch: foreign
|
||||
Description: documentation for the Jinja2 Python library
|
||||
Jinja2 is a small but fast and easy to use stand-alone template engine
|
||||
.
|
||||
This package contains the documentation for Jinja2 in HTML and
|
||||
reStructuredText formats.
|
||||
|
||||
Package: python3-jinja2
|
||||
Architecture: all
|
||||
Depends:
|
||||
python3-markupsafe (>= 2.0),
|
||||
${misc:Depends},
|
||||
${python3:Depends},
|
||||
Recommends:
|
||||
python3-babel,
|
||||
python3-pkg-resources,
|
||||
Suggests:
|
||||
python-jinja2-doc,
|
||||
Breaks:
|
||||
python-jinja2 (<< 2.11.1-1),
|
||||
Replaces:
|
||||
python-jinja2 (<< 2.11.1-1),
|
||||
Description: small but fast and easy to use stand-alone template engine
|
||||
Jinja2 is a template engine written in pure Python. It provides a Django
|
||||
inspired non-XML syntax but supports inline expressions and an optional
|
||||
sandboxed environment.
|
||||
.
|
||||
The key-features are:
|
||||
* Configurable syntax. If you are generating LaTeX or other formats with
|
||||
Jinja2 you can change the delimiters to something that integrates better
|
||||
into the LaTeX markup.
|
||||
* Fast. While performance is not the primarily target of Jinja2 it’s
|
||||
surprisingly fast. The overhead compared to regular Python code was reduced
|
||||
to the very minimum.
|
||||
* Easy to debug. Jinja2 integrates directly into the Python traceback system
|
||||
which allows you to debug Jinja2 templates with regular Python debugging
|
||||
helpers.
|
||||
* Secure. It’s possible to evaluate untrusted template code if the optional
|
||||
sandbox is enabled. This allows Jinja2 to be used as templating language
|
||||
for applications where users may modify the template design.
|
|
@ -0,0 +1,73 @@
|
|||
This package was debianized by Piotr Ożarowski <piotr@debian.org> on
|
||||
Mon, 14 Jul 2008 23:45:03 +0200.
|
||||
|
||||
It was downloaded from http://pypi.python.org/pypi/Jinja2
|
||||
|
||||
Copyright (c) 2009-2011 by the Jinja Team, see AUTHORS for more details.
|
||||
|
||||
Some rights reserved.
|
||||
|
||||
License:
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* 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.
|
||||
|
||||
* The names of the contributors may not 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
|
||||
OWNER 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.
|
||||
|
||||
---------------------------------------------------------------
|
||||
|
||||
docs/_build/html/_static/interface.js and docs/_build/html/_static/jquery.js
|
||||
(source package only) are part of jQuery project (Copyright (c) 2006 Stefan
|
||||
Petre) and are licensed under dual licensed under the MIT and GPL licenses.
|
||||
|
||||
---------------------------------------------------------------
|
||||
|
||||
ext/jinja.el (source package only):
|
||||
|
||||
Author: Georg Brandl
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth
|
||||
Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
On Debian systems, the complete text of the GNU General Public License
|
||||
can be found in `/usr/share/common-licenses/GPL'.
|
||||
|
||||
---------------------------------------------------------------
|
||||
|
||||
The Debian packaging is © 2008-2011, Piotr Ożarowski <piotr@debian.org> and
|
||||
is licensed under the same license as Jinja2.
|
|
@ -0,0 +1,135 @@
|
|||
" Vim syntax file
|
||||
" Language: Jinja template
|
||||
" Maintainer: Armin Ronacher <armin.ronacher@active-4.com>
|
||||
" Last Change: 2008 May 9
|
||||
" Version: 1.1
|
||||
"
|
||||
" Known Bugs:
|
||||
" because of odd limitations dicts and the modulo operator
|
||||
" appear wrong in the template.
|
||||
"
|
||||
" Changes:
|
||||
"
|
||||
" 2008 May 9: Added support for Jinja2 changes (new keyword rules)
|
||||
|
||||
" .vimrc variable to disable html highlighting
|
||||
if !exists('g:jinja_syntax_html')
|
||||
let g:jinja_syntax_html=1
|
||||
endif
|
||||
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
if !exists("main_syntax")
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
let main_syntax = 'jinja'
|
||||
endif
|
||||
|
||||
" Pull in the HTML syntax.
|
||||
if g:jinja_syntax_html
|
||||
if version < 600
|
||||
so <sfile>:p:h/html.vim
|
||||
else
|
||||
runtime! syntax/html.vim
|
||||
unlet b:current_syntax
|
||||
endif
|
||||
endif
|
||||
|
||||
syntax case match
|
||||
|
||||
" Jinja template built-in tags and parameters (without filter, macro, is and raw, they
|
||||
" have special threatment)
|
||||
syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained and if else in not or recursive as import
|
||||
|
||||
syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained is filter skipwhite nextgroup=jinjaFilter
|
||||
syn keyword jinjaStatement containedin=jinjaTagBlock contained macro skipwhite nextgroup=jinjaFunction
|
||||
syn keyword jinjaStatement containedin=jinjaTagBlock contained block skipwhite nextgroup=jinjaBlockName
|
||||
|
||||
" Variable Names
|
||||
syn match jinjaVariable containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[a-zA-Z_][a-zA-Z0-9_]*/
|
||||
syn keyword jinjaSpecial containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained false true none False True None loop super caller varargs kwargs
|
||||
|
||||
" Filters
|
||||
syn match jinjaOperator "|" containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained skipwhite nextgroup=jinjaFilter
|
||||
syn match jinjaFilter contained /[a-zA-Z_][a-zA-Z0-9_]*/
|
||||
syn match jinjaFunction contained /[a-zA-Z_][a-zA-Z0-9_]*/
|
||||
syn match jinjaBlockName contained /[a-zA-Z_][a-zA-Z0-9_]*/
|
||||
|
||||
" Jinja template constants
|
||||
syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/"/ skip=/\(\\\)\@<!\(\(\\\\\)\@>\)*\\"/ end=/"/
|
||||
syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/'/ skip=/\(\\\)\@<!\(\(\\\\\)\@>\)*\\'/ end=/'/
|
||||
syn match jinjaNumber containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[0-9]\+\(\.[0-9]\+\)\?/
|
||||
|
||||
" Operators
|
||||
syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[+\-*\/<>=!,:]/
|
||||
syn match jinjaPunctuation containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[()\[\]]/
|
||||
syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /\./ nextgroup=jinjaAttribute
|
||||
syn match jinjaAttribute contained /[a-zA-Z_][a-zA-Z0-9_]*/
|
||||
|
||||
" Jinja template tag and variable blocks
|
||||
syn region jinjaNested matchgroup=jinjaOperator start="(" end=")" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
|
||||
syn region jinjaNested matchgroup=jinjaOperator start="\[" end="\]" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
|
||||
syn region jinjaNested matchgroup=jinjaOperator start="{" end="}" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
|
||||
syn region jinjaTagBlock matchgroup=jinjaTagDelim start=/{%-\?/ end=/-\?%}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment
|
||||
|
||||
syn region jinjaVarBlock matchgroup=jinjaVarDelim start=/{{-\?/ end=/-\?}}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment
|
||||
|
||||
" Jinja template 'raw' tag
|
||||
syn region jinjaRaw matchgroup=jinjaRawDelim start="{%\s*raw\s*%}" end="{%\s*endraw\s*%}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString,jinjaComment
|
||||
|
||||
" Jinja comments
|
||||
syn region jinjaComment matchgroup=jinjaCommentDelim start="{#" end="#}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString,jinjaComment
|
||||
|
||||
" Block start keywords. A bit tricker. We only highlight at the start of a
|
||||
" tag block and only if the name is not followed by a comma or equals sign
|
||||
" which usually means that we have to deal with an assignment.
|
||||
syn match jinjaStatement containedin=jinjaTagBlock contained /\({%-\?\s*\)\@<=\<[a-zA-Z_][a-zA-Z0-9_]*\>\(\s*[,=]\)\@!/
|
||||
|
||||
" and context modifiers
|
||||
syn match jinjaStatement containedin=jinjaTagBlock contained /\<with\(out\)\?\s\+context\>/
|
||||
|
||||
|
||||
" Define the default highlighting.
|
||||
" For version 5.7 and earlier: only when not done already
|
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
||||
if version >= 508 || !exists("did_jinja_syn_inits")
|
||||
if version < 508
|
||||
let did_jinja_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
HiLink jinjaPunctuation jinjaOperator
|
||||
HiLink jinjaAttribute jinjaVariable
|
||||
HiLink jinjaFunction jinjaFilter
|
||||
|
||||
HiLink jinjaTagDelim jinjaTagBlock
|
||||
HiLink jinjaVarDelim jinjaVarBlock
|
||||
HiLink jinjaCommentDelim jinjaComment
|
||||
HiLink jinjaRawDelim jinja
|
||||
|
||||
HiLink jinjaSpecial Special
|
||||
HiLink jinjaOperator Normal
|
||||
HiLink jinjaRaw Normal
|
||||
HiLink jinjaTagBlock PreProc
|
||||
HiLink jinjaVarBlock PreProc
|
||||
HiLink jinjaStatement Statement
|
||||
HiLink jinjaFilter Function
|
||||
HiLink jinjaBlockName Function
|
||||
HiLink jinjaVariable Identifier
|
||||
HiLink jinjaString Constant
|
||||
HiLink jinjaNumber Constant
|
||||
HiLink jinjaComment Comment
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "jinja"
|
||||
|
||||
if main_syntax == 'jinja'
|
||||
unlet main_syntax
|
||||
endif
|
|
@ -0,0 +1,4 @@
|
|||
addon: jinja
|
||||
description: "allow syntax highlighting for Jinja templates"
|
||||
files:
|
||||
- syntax/jinja.vim
|
|
@ -0,0 +1,22 @@
|
|||
From: =?utf-8?q?Piotr_O=C5=BCarowski?= <piotr@debian.org>
|
||||
Date: Thu, 2 Apr 2020 13:41:14 +0200
|
||||
Subject: docs: disable sphinxcontrib.log_cabinet
|
||||
|
||||
it's not packaged in Debian yet
|
||||
---
|
||||
docs/conf.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/docs/conf.py b/docs/conf.py
|
||||
index f65d462..43bcfda 100644
|
||||
--- a/docs/conf.py
|
||||
+++ b/docs/conf.py
|
||||
@@ -15,7 +15,7 @@ extensions = [
|
||||
"sphinx.ext.autodoc",
|
||||
"sphinx.ext.intersphinx",
|
||||
"pallets_sphinx_themes",
|
||||
- "sphinxcontrib.log_cabinet",
|
||||
+ # "sphinxcontrib.log_cabinet",
|
||||
"sphinx_issues",
|
||||
]
|
||||
autodoc_typehints = "description"
|
|
@ -0,0 +1,38 @@
|
|||
From: =?utf-8?q?Piotr_O=C5=BCarowski?= <piotr@debian.org>
|
||||
Date: Fri, 24 Feb 2023 16:06:57 +0100
|
||||
Subject: fix nose leftovers
|
||||
|
||||
taken from upstream repo
|
||||
---
|
||||
tests/test_loader.py | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/tests/test_loader.py b/tests/test_loader.py
|
||||
index 04c921d..77d686e 100644
|
||||
--- a/tests/test_loader.py
|
||||
+++ b/tests/test_loader.py
|
||||
@@ -183,6 +183,7 @@ class TestFileSystemLoader:
|
||||
|
||||
class TestModuleLoader:
|
||||
archive = None
|
||||
+ mod_env = None
|
||||
|
||||
def compile_down(self, prefix_loader, zip="deflated"):
|
||||
log = []
|
||||
@@ -196,13 +197,14 @@ class TestModuleLoader:
|
||||
self.mod_env = Environment(loader=loaders.ModuleLoader(self.archive))
|
||||
return "".join(log)
|
||||
|
||||
- def teardown(self):
|
||||
- if hasattr(self, "mod_env"):
|
||||
+ def teardown_method(self):
|
||||
+ if self.archive is not None:
|
||||
if os.path.isfile(self.archive):
|
||||
os.remove(self.archive)
|
||||
else:
|
||||
shutil.rmtree(self.archive)
|
||||
self.archive = None
|
||||
+ self.mod_env = None
|
||||
|
||||
def test_log(self, prefix_loader):
|
||||
log = self.compile_down(prefix_loader)
|
|
@ -0,0 +1,92 @@
|
|||
From 7dd3680e6eea0d77fde024763657aa4d884ddb23 Mon Sep 17 00:00:00 2001
|
||||
From: Calum Hutton <calum.hutton@snyk.io>
|
||||
Date: Thu, 26 Oct 2023 12:08:53 +0100
|
||||
Subject: [PATCH] xmlattr filter disallows keys with spaces
|
||||
|
||||
---
|
||||
CHANGES.rst | 1 +
|
||||
src/jinja2/filters.py | 28 +++++++++++++++++++++-------
|
||||
tests/test_filters.py | 6 ++++++
|
||||
3 files changed, 28 insertions(+), 7 deletions(-)
|
||||
|
||||
#diff --git a/CHANGES.rst b/CHANGES.rst
|
||||
#index 36db0843a..d6688e762 100644
|
||||
#--- a/CHANGES.rst
|
||||
#+++ b/CHANGES.rst
|
||||
#@@ -7,6 +7,7 @@ Unreleased
|
||||
#
|
||||
# - Fix compiler error when checking if required blocks in parent templates are
|
||||
# empty. :pr:`1858`
|
||||
#+- ``xmlattr`` filter does not allow keys with spaces. GHSA-h5c8-rqwp-cp95
|
||||
#
|
||||
#
|
||||
# Version 3.1.2
|
||||
diff --git a/src/jinja2/filters.py b/src/jinja2/filters.py
|
||||
index ed07c4c0e..c7ecc9bb6 100644
|
||||
--- a/src/jinja2/filters.py
|
||||
+++ b/src/jinja2/filters.py
|
||||
@@ -248,13 +248,17 @@ def do_items(value: t.Union[t.Mapping[K, V], Undefined]) -> t.Iterator[t.Tuple[K
|
||||
yield from value.items()
|
||||
|
||||
|
||||
+_space_re = re.compile(r"\s", flags=re.ASCII)
|
||||
+
|
||||
+
|
||||
@pass_eval_context
|
||||
def do_xmlattr(
|
||||
eval_ctx: "EvalContext", d: t.Mapping[str, t.Any], autospace: bool = True
|
||||
) -> str:
|
||||
"""Create an SGML/XML attribute string based on the items in a dict.
|
||||
- All values that are neither `none` nor `undefined` are automatically
|
||||
- escaped:
|
||||
+
|
||||
+ If any key contains a space, this fails with a ``ValueError``. Values that
|
||||
+ are neither ``none`` nor ``undefined`` are automatically escaped.
|
||||
|
||||
.. sourcecode:: html+jinja
|
||||
|
||||
@@ -273,12 +277,22 @@ def do_xmlattr(
|
||||
|
||||
As you can see it automatically prepends a space in front of the item
|
||||
if the filter returned something unless the second parameter is false.
|
||||
+
|
||||
+ .. versionchanged:: 3.1.3
|
||||
+ Keys with spaces are not allowed.
|
||||
"""
|
||||
- rv = " ".join(
|
||||
- f'{escape(key)}="{escape(value)}"'
|
||||
- for key, value in d.items()
|
||||
- if value is not None and not isinstance(value, Undefined)
|
||||
- )
|
||||
+ items = []
|
||||
+
|
||||
+ for key, value in d.items():
|
||||
+ if value is None or isinstance(value, Undefined):
|
||||
+ continue
|
||||
+
|
||||
+ if _space_re.search(key) is not None:
|
||||
+ raise ValueError(f"Spaces are not allowed in attributes: '{key}'")
|
||||
+
|
||||
+ items.append(f'{escape(key)}="{escape(value)}"')
|
||||
+
|
||||
+ rv = " ".join(items)
|
||||
|
||||
if autospace and rv:
|
||||
rv = " " + rv
|
||||
diff --git a/tests/test_filters.py b/tests/test_filters.py
|
||||
index 32897c546..f50ed13ab 100644
|
||||
--- a/tests/test_filters.py
|
||||
+++ b/tests/test_filters.py
|
||||
@@ -474,6 +474,12 @@ def test_xmlattr(self, env):
|
||||
assert 'bar="23"' in out
|
||||
assert 'blub:blub="<?>"' in out
|
||||
|
||||
+ def test_xmlattr_key_with_spaces(self, env):
|
||||
+ with pytest.raises(ValueError, match="Spaces are not allowed"):
|
||||
+ env.from_string(
|
||||
+ "{{ {'src=1 onerror=alert(1)': 'my_class'}|xmlattr }}"
|
||||
+ ).render()
|
||||
+
|
||||
def test_sort1(self, env):
|
||||
tmpl = env.from_string("{{ [2, 3, 1]|sort }}|{{ [2, 3, 1]|sort(true) }}")
|
||||
assert tmpl.render() == "[1, 2, 3]|[3, 2, 1]"
|
|
@ -0,0 +1,104 @@
|
|||
From: Thomas Goirand <zigo@debian.org>
|
||||
Date: Wed, 1 Apr 2020 14:08:47 +0200
|
||||
Subject: Python 3.9: fix collections import
|
||||
|
||||
Bug-Debian: https://bugs.debian.org/949018
|
||||
Forwarded: no
|
||||
Last-Update: 2020-02-27
|
||||
|
||||
As collections has moved to collections.abc, this produces a warning which
|
||||
may lead to unit testing errors: this is the case when building Rally.
|
||||
|
||||
This patch attempts to import from collections.abc, and if it fails, falls
|
||||
back to collections. This should be harmless.
|
||||
|
||||
Note that this patch is probably useless with future version, as hopefully,
|
||||
upstream will fix it (I didn't check). However, I didn't dare upgrading the
|
||||
package to the major upstream release 3.x.
|
||||
---
|
||||
src/jinja2/lexer.py | 5 ++++-
|
||||
src/jinja2/nodes.py | 5 ++++-
|
||||
src/jinja2/sandbox.py | 5 ++++-
|
||||
src/jinja2/utils.py | 5 ++++-
|
||||
tests/test_utils.py | 5 ++++-
|
||||
5 files changed, 20 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/jinja2/lexer.py b/src/jinja2/lexer.py
|
||||
index aff7e9f..37ef342 100644
|
||||
--- a/src/jinja2/lexer.py
|
||||
+++ b/src/jinja2/lexer.py
|
||||
@@ -6,7 +6,10 @@ template code and python code in expressions.
|
||||
import re
|
||||
import typing as t
|
||||
from ast import literal_eval
|
||||
-from collections import deque
|
||||
+try:
|
||||
+ from collections.abc import deque
|
||||
+except ImportError:
|
||||
+ from collections import deque
|
||||
from sys import intern
|
||||
|
||||
from ._identifier import pattern as name_re
|
||||
diff --git a/src/jinja2/nodes.py b/src/jinja2/nodes.py
|
||||
index b2f88d9..53da1e9 100644
|
||||
--- a/src/jinja2/nodes.py
|
||||
+++ b/src/jinja2/nodes.py
|
||||
@@ -5,7 +5,10 @@ to normalize nodes.
|
||||
import inspect
|
||||
import operator
|
||||
import typing as t
|
||||
-from collections import deque
|
||||
+try:
|
||||
+ from collections.abc import deque
|
||||
+except ImportError:
|
||||
+ from collections import deque
|
||||
|
||||
from markupsafe import Markup
|
||||
|
||||
diff --git a/src/jinja2/sandbox.py b/src/jinja2/sandbox.py
|
||||
index 06d7414..f443c18 100644
|
||||
--- a/src/jinja2/sandbox.py
|
||||
+++ b/src/jinja2/sandbox.py
|
||||
@@ -6,7 +6,10 @@ import types
|
||||
import typing as t
|
||||
from _string import formatter_field_name_split # type: ignore
|
||||
from collections import abc
|
||||
-from collections import deque
|
||||
+try:
|
||||
+ from collections.abc import deque
|
||||
+except ImportError:
|
||||
+ from collections import deque
|
||||
from string import Formatter
|
||||
|
||||
from markupsafe import EscapeFormatter
|
||||
diff --git a/src/jinja2/utils.py b/src/jinja2/utils.py
|
||||
index 9b5f5a5..205b2af 100644
|
||||
--- a/src/jinja2/utils.py
|
||||
+++ b/src/jinja2/utils.py
|
||||
@@ -4,7 +4,10 @@ import os
|
||||
import re
|
||||
import typing as t
|
||||
from collections import abc
|
||||
-from collections import deque
|
||||
+try:
|
||||
+ from collections.abc import deque
|
||||
+except ImportError:
|
||||
+ from collections import deque
|
||||
from random import choice
|
||||
from random import randrange
|
||||
from threading import Lock
|
||||
diff --git a/tests/test_utils.py b/tests/test_utils.py
|
||||
index 7b58af1..9013d7c 100644
|
||||
--- a/tests/test_utils.py
|
||||
+++ b/tests/test_utils.py
|
||||
@@ -1,6 +1,9 @@
|
||||
import pickle
|
||||
import random
|
||||
-from collections import deque
|
||||
+try:
|
||||
+ from collections.abc import deque
|
||||
+except ImportError:
|
||||
+ from collections import deque
|
||||
from copy import copy as shallow_copy
|
||||
|
||||
import pytest
|
|
@ -0,0 +1,4 @@
|
|||
py3.9-fix-collections-import.patch
|
||||
0002-docs-disable-sphinxcontrib.log_cabinet.patch
|
||||
0003-fix-nose-leftovers.patch
|
||||
CVE-2024-22195.patch
|
|
@ -0,0 +1 @@
|
|||
docs/_build/html
|
|
@ -0,0 +1 @@
|
|||
examples/*
|
|
@ -0,0 +1,5 @@
|
|||
/usr/share/doc/python-jinja2-doc/examples /usr/share/doc/python3-jinja2/examples
|
||||
/usr/share/doc/python-jinja2-doc/html /usr/share/doc/python-jinja2/html
|
||||
/usr/share/doc/python-jinja2-doc/html /usr/share/doc/python3-jinja2/html
|
||||
/usr/share/doc/python-jinja2-doc/html/_sources /usr/share/doc/python-jinja2/rst
|
||||
/usr/share/doc/python-jinja2-doc/html/_sources /usr/share/doc/python3-jinja2/rst
|
|
@ -0,0 +1,2 @@
|
|||
jinja2/asyncfilters.py
|
||||
jinja2/asyncsupport.py
|
|
@ -0,0 +1 @@
|
|||
re|-3.6|/usr/lib/python3/dist-packages/jinja2|.*/async(support|filters).py
|
|
@ -0,0 +1,2 @@
|
|||
/usr/share/vim/addons/syntax/
|
||||
/usr/share/vim/registry
|
|
@ -0,0 +1,2 @@
|
|||
debian/jinja.yaml /usr/share/vim/registry
|
||||
debian/jinja.vim /usr/share/vim/addons/syntax/
|
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/make -f
|
||||
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
export PYBUILD_NAME=jinja2
|
||||
|
||||
%:
|
||||
dh $@ --with python3,sphinxdoc --buildsystem=pybuild
|
||||
|
||||
override_dh_auto_clean:
|
||||
make -C docs clean
|
||||
dh_auto_clean
|
||||
|
||||
override_dh_auto_build:
|
||||
# make sure installed version of jinja2 is not used during tests:
|
||||
dh_auto_build -- --disable=test
|
||||
pybuild --test --system=custom --test-args='PYTHONPATH="{build_dir}" {interpreter} -m pytest tests'
|
||||
# build documentation
|
||||
PYTHONPATH=$(CURDIR)/src:$(CURDIR)/docs make -C docs html
|
||||
|
||||
override_dh_installdocs:
|
||||
# install into -doc package and keep the symlink
|
||||
dh_installdocs -p python-jinja2-doc --doc-main-package python-jinja2-doc
|
||||
dh_installdocs --remaining
|
||||
|
||||
override_dh_installexamples:
|
||||
# install into -doc package and keep the symlink
|
||||
dh_installexamples -p python-jinja2-doc --doc-main-package python-jinja2-doc
|
||||
dh_installexamples --remaining
|
||||
|
||||
override_dh_installchangelogs:
|
||||
dh_installchangelogs CHANGES.rst
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
include:
|
||||
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
|
||||
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
|
|
@ -0,0 +1 @@
|
|||
3.0 (quilt)
|
|
@ -0,0 +1,4 @@
|
|||
Tests: unittests
|
||||
Depends:
|
||||
@builddeps@,
|
||||
Restrictions: allow-stderr
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
CWD=$(pwd)
|
||||
PYTHON3S=$(py3versions -vs)
|
||||
for i in ${PYTHON3S} ; do
|
||||
PYTHON=python${i} python${i} -m pytest -v tests
|
||||
done
|
|
@ -0,0 +1,3 @@
|
|||
version=3
|
||||
opts=uversionmangle=s/(rc|a|b|c)/~$1/ \
|
||||
https://pypi.debian.net/Jinja2/Jinja2-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
|
Loading…
Reference in New Issue