From 405b975d91bae9843a87b66ee70398c30a271b35 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sun, 15 May 2022 11:19:26 +0200 Subject: [PATCH] upgrade jinja2 to version 2.11.3 Fixes this error when using python 3.10: Traceback (most recent call last): File "/usr/bin/gcovr", line 33, in sys.exit(load_entry_point('gcovr==5.0', 'console_scripts', 'gcovr')()) File "/usr/lib/python3/dist-packages/gcovr/__main__.py", line 280, in main error_occurred = print_reports(covdata, options, logger) File "/usr/lib/python3/dist-packages/gcovr/__main__.py", line 432, in print_reports if generator(covdata, output.abspath, options): File "/usr/lib/python3/dist-packages/gcovr/writer/html.py", line 281, in print_html_report css_data = CssRenderer.render(options) File "/usr/lib/python3/dist-packages/gcovr/writer/html.py", line 121, in render template = templates().get_template('style.css') File "/usr/lib/python3/dist-packages/gcovr/writer/html.py", line 44, in __call__ return self.get(*args) File "/usr/lib/python3/dist-packages/gcovr/writer/html.py", line 33, in load result = fn(*args) File "/usr/lib/python3/dist-packages/gcovr/writer/html.py", line 52, in templates from jinja2 import Environment, PackageLoader File "/root/.local/lib/python3.10/site-packages/jinja2/__init__.py", line 33, in from jinja2.environment import Environment, Template File "/root/.local/lib/python3.10/site-packages/jinja2/environment.py", line 16, in from jinja2.defaults import BLOCK_START_STRING, \ File "/root/.local/lib/python3.10/site-packages/jinja2/defaults.py", line 32, in from jinja2.tests import TESTS as DEFAULT_TESTS File "/root/.local/lib/python3.10/site-packages/jinja2/tests.py", line 13, in from collections import Mapping ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py) We cannot upgrade to jinja 3.x since gcovr would then give this error: Traceback (most recent call last): File "/usr/bin/gcovr", line 33, in sys.exit(load_entry_point('gcovr==5.0', 'console_scripts', 'gcovr')()) File "/usr/lib/python3/dist-packages/gcovr/__main__.py", line 280, in main error_occurred = print_reports(covdata, options, logger) File "/usr/lib/python3/dist-packages/gcovr/__main__.py", line 432, in print_reports if generator(covdata, output.abspath, options): File "/usr/lib/python3/dist-packages/gcovr/writer/html.py", line 401, in print_html_report lines = formatter.highlighter_for_file(data['filename'])(source_file.read()) File "/usr/lib/python3/dist-packages/gcovr/writer/html.py", line 159, in highlighter_for_file from jinja2 import Markup ImportError: cannot import name 'Markup' from 'jinja2' (/root/.local/lib/python3.10/site-packages/jinja2/__init__.py) --- doc/infosrc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/infosrc/requirements.txt b/doc/infosrc/requirements.txt index 8af10ac35..3d3024ec8 100644 --- a/doc/infosrc/requirements.txt +++ b/doc/infosrc/requirements.txt @@ -1,2 +1,2 @@ json2html==1.3.0 -Jinja2==2.10 +Jinja2==2.11.3 -- 2.40.0