Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-Lektor for openSUSE:Factory checked in at 2022-01-06 15:51:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-Lektor (Old) and /work/SRC/openSUSE:Factory/.python-Lektor.new.1896 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Lektor" Thu Jan 6 15:51:21 2022 rev:7 rq:944195 version:3.3.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-Lektor/python-Lektor.changes 2021-12-09 19:46:06.225147537 +0100 +++ /work/SRC/openSUSE:Factory/.python-Lektor.new.1896/python-Lektor.changes 2022-01-06 15:52:05.304997780 +0100 @@ -1,0 +2,21 @@ +Wed Jan 5 16:39:36 UTC 2022 - Matej Cepl <mc...@suse.com> + +- Upgrade to 3.3.0: + - This release drops support for versions of Python before + 3.6. In particular, Python 2.7 is no longer supported. + - Quite a few bugs have been fixed since the previous release. + - The Admin UI has seen a major refactor and various + performance optimisations. It has been rewritten in + Typescript, and updated to use v5 of the Bootstrap CSS + framework. +- Remove unnecessary patches: + - more_recent_werkzeug.patch + - werkzeug_rename.patch +- Added patches making things working: + - new_version_of_mistune.patch (gh#lektor/lektor#944) make the + package work with mistune 2.* + - skip-network-tests.patch (gh#lektor/lektor#982) we build in + the network isolated environment, we need to make tests which + need it + +------------------------------------------------------------------- Old: ---- Lektor-3.2.0.tar.gz more_recent_werkzeug.patch werkzeug_rename.patch New: ---- Lektor-3.3.0.tar.gz new_version_of_mistune.patch skip-network-tests.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-Lektor.spec ++++++ --- /var/tmp/diff_new_pack.CUuboh/_old 2022-01-06 15:52:05.768998036 +0100 +++ /var/tmp/diff_new_pack.CUuboh/_new 2022-01-06 15:52:05.772998038 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-Lektor # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,18 +19,23 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %bcond_without python2 Name: python-Lektor -Version: 3.2.0 +Version: 3.3.0 Release: 0 Summary: A static content management system License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/lektor/lektor/ -Source: https://github.com/lektor/lektor/archive/%{version}.tar.gz#/Lektor-%{version}.tar.gz -# PATCH-FIX-UPSTREAM werkzeug_rename.patch gh#lektor/lektor#911 mc...@suse.com -# werkzeug.posixemulation doesn't exist anymore -Patch0: werkzeug_rename.patch -Patch1: more_recent_werkzeug.patch +Source0: https://github.com/lektor/Lektor/archive/refs/tags/v%{version}.tar.gz#/Lektor-%{version}.tar.gz +# PATCH-FIX-UPSTREAM new_version_of_mistune.patch gh#lektor/lektor#944 mc...@suse.com +# Make package working with mistune 2.* +Patch0: new_version_of_mistune.patch +# PATCH-FIX-UPSTREAM skip-network-tests.patch gh#lektor/lektor#982 mc...@suse.com +# mark tests as requiring network connection, so we can skip them +Patch1: skip-network-tests.patch +BuildRequires: %{python_module flit-core} +BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-Babel @@ -60,7 +65,6 @@ BuildRequires: %{python_module filetype >= 1.0.7} BuildRequires: %{python_module inifile} BuildRequires: %{python_module mistune >= 0.7.0} -BuildRequires: %{python_module pip} BuildRequires: %{python_module pyOpenSSL >= 0.14} BuildRequires: %{python_module pylint} BuildRequires: %{python_module pytest-click} @@ -87,15 +91,11 @@ %prep %autosetup -p1 -n lektor-%{version} -sed -i '/pytest-pylint/d;/pytest-cov/d' setup.py - -rm pytest.ini - %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_clone -a %{buildroot}%{_bindir}/lektor %python_expand %fdupes %{buildroot}%{$python_sitelib} @@ -103,8 +103,8 @@ export LANG=en_US.UTF8 # Test suite expects a git repo git init -# These failures not yet investigated gh#lektor/lektor#918 -%pytest -k 'not (test_build_continue_in_existing_nonempty_dir and not test_build and not test_thumbnail_quality or test_build_continue_in_existing_nonempty_dir or test_build or test_deprecated_build_flag or test_thumbnail_dimensions_real or test_thumbnails_similar or test_thumbnails_differing or test_thumbnail_quality or test_plugin_build_events_via_cli or test_plugin_clean_events_via_cli or test_env_extra_flag_passthrough or test_multiple_extra_flags or test_plugin_bad_params)' +# test_markdown_links is skipped because of gh#lektor/lektor#982 +%pytest -k 'not (network or test_markdown_links)' %post %python_install_alternative lektor ++++++ Lektor-3.2.0.tar.gz -> Lektor-3.3.0.tar.gz ++++++ ++++ 56099 lines of diff (skipped) ++++++ new_version_of_mistune.patch ++++++ >From 20c01cf12fab27c26d1bb0b66c9dca5904cfa148 Mon Sep 17 00:00:00 2001 From: Evilham <c...@evilham.com> Date: Sun, 10 Oct 2021 20:45:50 +0200 Subject: [PATCH 1/5] Support newer mistune versions in addition to older ones It looks like lepture has been busy and mistune 2.0.0 is about to be released, there is already some software that depends on its alpha/rc versions and rather than backporting that, it makes more sense to prepare Lektor to be compatible with the newer version. This patch aims to introduce minimal changes to achieve that while keeping compatibility with mistune 0.8.X. --- lektor/markdown.py | 68 +++++++++++++++++++++++++++++++++++------------------ setup.cfg | 2 - 2 files changed, 46 insertions(+), 24 deletions(-) --- a/lektor/markdown.py +++ b/lektor/markdown.py @@ -11,30 +11,50 @@ from lektor.context import get_ctx _markdown_cache = threading.local() +_old_mistune = int(mistune.__version__.split(".", maxsplit=1)[0]) < 2 -class ImprovedRenderer(mistune.Renderer): - def link(self, link, title, text): - if self.record is not None: - url = url_parse(link) - if not url.scheme: - link = self.record.url_to("!" + link, base_url=get_ctx().base_url) - link = escape(link) - if not title: - return '<a href="%s">%s</a>' % (link, text) - title = escape(title) - return '<a href="%s" title="%s">%s</a>' % (link, title, text) +if _old_mistune: - def image(self, src, title, text): - if self.record is not None: - url = url_parse(src) - if not url.scheme: - src = self.record.url_to("!" + src, base_url=get_ctx().base_url) - src = escape(src) - text = escape(text) - if title: - title = escape(title) - return '<img src="%s" alt="%s" title="%s">' % (src, text, title) - return '<img src="%s" alt="%s">' % (src, text) + class ImprovedRenderer(mistune.Renderer): + def link(self, link, title, text): + return _render_link(link, text, title, record=self.record) + + def image(self, src, title, text): + return _render_image(src, text, title, record=self.record) + +else: + + class ImprovedRenderer(mistune.HTMLRenderer): + def link(self, link, text=None, title=None): + return _render_link(link, text, title, record=self.record) + + def image(self, src, alt=None, title=None): + return _render_image(src, alt, title, record=self.record) + + +def _render_link(link, text=None, title=None, record=None): + if record is not None: + url = url_parse(link) + if not url.scheme: + link = record.url_to("!" + link, base_url=get_ctx().base_url) + link = escape(link) + if not title: + return '<a href="%s">%s</a>' % (link, text) + title = escape(title) + return '<a href="%s" title="%s">%s</a>' % (link, title, text) + + +def _render_image(src, alt="", title=None, record=None): + if record is not None: + url = url_parse(src) + if not url.scheme: + src = record.url_to("!" + src, base_url=get_ctx().base_url) + src = escape(src) + alt = escape(alt) + if title: + title = escape(title) + return '<img src="%s" alt="%s" title="%s">' % (src, alt, title) + return '<img src="%s" alt="%s">' % (src, alt) class MarkdownConfig: @@ -56,7 +76,9 @@ def make_markdown(env): env.plugin_controller.emit("markdown-config", config=cfg) renderer = cfg.make_renderer() env.plugin_controller.emit("markdown-lexer-config", config=cfg, renderer=renderer) - return mistune.Markdown(renderer, **cfg.options) + if _old_mistune: + return mistune.Markdown(renderer, **cfg.options) + return mistune.create_markdown(renderer=renderer, **cfg.options) def markdown_to_html(text, record=None): --- a/setup.cfg +++ b/setup.cfg @@ -37,7 +37,7 @@ install_requires = Flask inifile>=0.4.1 Jinja2>=3.0 - mistune>=0.7.0,<2 + mistune>=0.7.0,<3.0 pip python-slugify requests[security] ++++++ skip-network-tests.patch ++++++ --- pytest.ini | 2 ++ tests/test_pluginsystem.py | 1 + 2 files changed, 3 insertions(+) --- a/pytest.ini +++ b/pytest.ini @@ -1,2 +1,4 @@ [pytest] norecursedirs = venv +markers = + network: tests requiring network connection --- a/tests/test_pluginsystem.py +++ b/tests/test_pluginsystem.py @@ -155,6 +155,7 @@ class TestPlugin: def test_path(self, dummy_plugin): assert dummy_plugin.path == str(Path(__file__).parent) + @pytest.mark.network @pytest.mark.usefixtures("save_sys_path") def test_path_installed_plugin_is_none(self, scratch_project): # XXX: this test is slow and fragile. (It won't run