From a410b543b7b9cd37ad512ef3b65c7a46f751f9230079c9b7134dc5672a80ddfa Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 22 Jul 2025 03:10:12 +0000 Subject: [PATCH] - Do not install testsuite. - Add patch support-new-bs4.patch: * Support new bs4 changes. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pelican?expand=0&rev=60 --- python-pelican.changes | 7 +++ python-pelican.spec | 10 +++-- support-new-bs4.patch | 97 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 111 insertions(+), 3 deletions(-) create mode 100644 support-new-bs4.patch diff --git a/python-pelican.changes b/python-pelican.changes index 92ba55e..a8bbd33 100644 --- a/python-pelican.changes +++ b/python-pelican.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Jul 22 03:09:19 UTC 2025 - Steve Kowalik + +- Do not install testsuite. +- Add patch support-new-bs4.patch: + * Support new bs4 changes. + ------------------------------------------------------------------- Thu Jan 16 20:16:19 UTC 2025 - BenoƮt Monin diff --git a/python-pelican.spec b/python-pelican.spec index 4be50b3..cfc6cb6 100644 --- a/python-pelican.spec +++ b/python-pelican.spec @@ -22,9 +22,10 @@ Version: 4.11.0 Release: 0 Summary: A tool to generate a static blog from reStructuredText or Markdown input files License: AGPL-3.0-only -Group: Development/Languages/Python URL: https://getpelican.com/ Source: https://github.com/getpelican/pelican/archive/refs/tags/%{version}.tar.gz#/pelican-%{version}-gh.tar.gz +# PATCH-FIX-UPSTREAM gh#getpelican/pelican#3461 +Patch0: support-new-bs4.patch BuildRequires: %{python_module Jinja2 >= 3.1.2} BuildRequires: %{python_module Pygments >= 2.16.1} BuildRequires: %{python_module Unidecode >= 1.3.7} @@ -119,7 +120,10 @@ chmod -x \ %install %pyproject_install -%python_expand %fdupes %{buildroot}%{$python_sitelib} +# Do not install tests +%{python_expand rm -r %{buildroot}%{$python_sitelib}/pelican/tests +%fdupes %{buildroot}%{$python_sitelib} +} for p in pelican pelican-import pelican-plugins pelican-quickstart pelican-themes; do %python_clone -a %{buildroot}%{_bindir}/$p @@ -146,6 +150,6 @@ export PYTHONPATH=. %python_alternative %{_bindir}/pelican-quickstart %python_alternative %{_bindir}/pelican-themes %{python_sitelib}/pelican -%{python_sitelib}/pelican-*.dist-info +%{python_sitelib}/pelican-%{version}.dist-info %changelog diff --git a/support-new-bs4.patch b/support-new-bs4.patch new file mode 100644 index 0000000..9fa9f3d --- /dev/null +++ b/support-new-bs4.patch @@ -0,0 +1,97 @@ +From 49941b62c7edabd051c6a79306e5db986186f890 Mon Sep 17 00:00:00 2001 +From: Justin Mayer +Date: Fri, 11 Apr 2025 18:33:27 +0200 +Subject: [PATCH] Upgrade Beautiful Soup & adjust tests to conform + +--- + pelican/tools/pelican_import.py | 18 +++++++++--------- + pyproject.toml | 2 +- + 2 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py +index 65517f42a..7270488e9 100755 +--- a/pelican/tools/pelican_import.py ++++ b/pelican/tools/pelican_import.py +@@ -27,7 +27,7 @@ + + def decode_wp_content(content, br=True): + pre_tags = {} +- if content.strip() == "": ++ if content is None or content.strip() == "": + return "" + + content += "\n" +@@ -148,7 +148,7 @@ def wp2fields(xml, wp_custpost=False): + """Opens a wordpress XML file, and yield Pelican fields""" + + soup = file_to_soup(xml) +- items = soup.rss.channel.findAll("item") ++ items = soup.rss.channel.find_all("item") + for item in items: + if item.find("status").string in ["publish", "draft"]: + try: +@@ -172,11 +172,11 @@ def wp2fields(xml, wp_custpost=False): + author = item.find("creator").string + + categories = [ +- cat.string for cat in item.findAll("category", {"domain": "category"}) ++ cat.string for cat in item.find_all("category", {"domain": "category"}) + ] + + tags = [ +- tag.string for tag in item.findAll("category", {"domain": "post_tag"}) ++ tag.string for tag in item.find_all("category", {"domain": "post_tag"}) + ] + # To publish a post the status should be 'published' + status = ( +@@ -218,7 +218,7 @@ def blogger2fields(xml): + """Opens a blogger XML file, and yield Pelican fields""" + + soup = file_to_soup(xml) +- entries = soup.feed.findAll("entry") ++ entries = soup.feed.find_all("entry") + for entry in entries: + raw_kind = entry.find( + "category", {"scheme": "http://schemas.google.com/g/2005#kind"} +@@ -253,7 +253,7 @@ def blogger2fields(xml): + # blogger posts only have tags, no category + tags = [ + tag.get("term") +- for tag in entry.findAll( ++ for tag in entry.find_all( + "category", {"scheme": "http://www.blogger.com/atom/ns#"} + ) + ] +@@ -571,8 +571,8 @@ def strip_medium_post_content(soup) -> str: + # See https://stackoverflow.com/a/8439761 + invalid_tags = ["section", "div", "footer"] + for tag in invalid_tags: +- for match in soup.findAll(tag): +- match.replaceWithChildren() ++ for match in soup.find_all(tag): ++ match.unwrap() + + # Remove attributes + # See https://stackoverflow.com/a/9045719 +@@ -845,7 +845,7 @@ def get_attachments(xml): + of the attachment_urls + """ + soup = file_to_soup(xml) +- items = soup.rss.channel.findAll("item") ++ items = soup.rss.channel.find_all("item") + names = {} + attachments = [] + +diff --git a/pyproject.toml b/pyproject.toml +index 014ebfc8c..9684d6df5 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -78,7 +78,7 @@ test = "invoke tests" + + [tool.pdm.dev-dependencies] + dev = [ +- "BeautifulSoup4>=4.12.2", ++ "BeautifulSoup4>=4.13.3", + "jinja2>=3.1.2", + "lxml>=4.9.3", + "markdown>=3.5.1",