Skip to content

Commit f7e223b

Browse files
authored
Upgrade python-beautifulsoup4 version to 4.12.3 (#13064)
1 parent 97d5876 commit f7e223b

4 files changed

Lines changed: 159 additions & 42 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"Signatures": {
3-
"python-beautifulsoup4-4.11.2.tar.gz": "bc4bdda6717de5a2987436fb8d72f45dc90dd856bdfd512a1314ce90349a0106"
3+
"python-beautifulsoup4-4.12.3.tar.gz": "74e3d1928edc070d21748185c46e3fb33490f22f52a3addee9aee0f4f7781051"
44
}
55
}

SPECS-EXTENDED/python-beautifulsoup4/python-beautifulsoup4.spec

Lines changed: 108 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,65 @@
1-
%global srcname beautifulsoup4
2-
%global _description %{expand:
3-
Beautiful Soup is a Python HTML/XML parser designed for quick
4-
turnaround projects like screen-scraping. Three features make it
5-
powerful:
6-
Beautiful Soup won't choke if you give it bad markup.
7-
Beautiful Soup provides a few simple methods and Pythonic idioms for
8-
Beautiful Soup automatically converts incoming documents to Unicode
9-
and outgoing documents to UTF-8.
10-
Beautiful Soup parses anything you give it.
11-
Valuable data that was once locked up in poorly-designed websites is
12-
now within your reach. Projects that would have taken hours take only
13-
minutes with Beautiful Soup.}
14-
151
# Ciruclar dependency with soupsieve which must be disabled at times
16-
%bcond_without soupsieve
2+
%bcond soupsieve 1
3+
%bcond tests 1
4+
5+
Name: python-beautifulsoup4
6+
Version: 4.12.3
7+
Release: 8%{?dist}
178
Summary: HTML/XML parser for quick-turnaround applications like screen-scraping
18-
Name: python-%{srcname}
19-
Version: 4.11.2
20-
Release: 2%{?dist}
219
License: MIT
2210
Vendor: Microsoft Corporation
2311
Distribution: Azure Linux
2412
URL: https://www.crummy.com/software/BeautifulSoup/
25-
Source0: https://files.pythonhosted.org/packages/source/b/%{srcname}/%{srcname}-%{version}.tar.gz#/%{name}-%{version}.tar.gz
13+
Source0: https://files.pythonhosted.org/packages/source/b/beautifulsoup4/beautifulsoup4-%{version}.tar.gz#/%{name}-%{version}.tar.gz
14+
# https://git.launchpad.net/beautifulsoup/commit/?id=9786a62726de5a8caba10021c4d4a58c8a3e9e3f
15+
16+
Patch0: soupsieve26.patch
17+
2618
BuildArch: noarch
19+
# html5lib BR just for test coverage
20+
%if %{with tests}
21+
BuildRequires: python3-html5lib
22+
BuildRequires: python3-lxml
23+
%endif
2724
BuildRequires: python3-devel
2825
BuildRequires: python3-setuptools
29-
%if %{with soupsieve}
26+
BuildRequires: python3-pip
3027
BuildRequires: python3-pytest
28+
BuildRequires: python3-wheel
29+
BuildRequires: python3-hatchling
30+
BuildRequires: python3-pathspec
31+
BuildRequires: python3-trove-classifiers
32+
BuildRequires: python3-tox
33+
BuildRequires: python-filelock
34+
BuildRequires: python3-toml
35+
BuildRequires: python3-virtualenv
36+
BuildRequires: python3-colorama
37+
BuildRequires: python3-chardet
38+
BuildRequires: python-cachetools
39+
BuildRequires: python3-pyproject-api
40+
%if %{with soupsieve}
41+
BuildRequires: python3-packaging
3142
BuildRequires: python3-soupsieve
3243
%endif
33-
BuildRequires: python3-lxml
34-
# html5lib BR just for test coverage
35-
%if 0%{?with_check}
36-
BuildRequires: python3-html5lib
37-
%endif
44+
45+
%global _description %{expand:
46+
Beautiful Soup is a Python HTML/XML parser designed for quick
47+
turnaround projects like screen-scraping. Three features make it
48+
powerful:
49+
50+
Beautiful Soup won't choke if you give it bad markup.
51+
52+
Beautiful Soup provides a few simple methods and Pythonic idioms for
53+
navigating, searching, and modifying a parse tree.
54+
55+
Beautiful Soup automatically converts incoming documents to Unicode
56+
and outgoing documents to UTF-8.
57+
58+
Beautiful Soup parses anything you give it.
59+
60+
Valuable data that was once locked up in poorly-designed websites is
61+
now within your reach. Projects that would have taken hours take only
62+
minutes with Beautiful Soup.}
3863

3964
%description %_description
4065

@@ -50,32 +75,75 @@ Obsoletes: python3-BeautifulSoup < 1:3.2.1-2
5075
%description -n python3-beautifulsoup4 %_description
5176

5277
%prep
53-
%autosetup -n %{srcname}-%{version}
54-
rm -rf %{py3dir} && cp -a . %{py3dir}
78+
%autosetup -p1 -n beautifulsoup4-%{version}
79+
# Fix compatibility with lxml 5.3.0
80+
# Reported upstream: https://bugs.launchpad.net/beautifulsoup/+bug/2076897
81+
sed -i "s/strip_cdata=False,//" bs4/builder/_lxml.py
82+
83+
%generate_buildrequires
84+
%pyproject_buildrequires %{?with_tests: -t}
5585

5686
%build
57-
pushd %{py3dir}
58-
%py3_build
87+
%pyproject_wheel
5988

6089
%install
61-
pushd %{py3dir}
62-
%py3_install
90+
%pyproject_install
91+
%pyproject_save_files bs4
6392

93+
%if %{with tests}
6494
%check
65-
%py3_check_import bs4
66-
pushd %{py3dir}
67-
python3 -m unittest discover -s bs4 || :
95+
python3 -m tox -q --recreate -e py312
96+
%endif
6897

6998
%files -n python3-beautifulsoup4
7099
%license LICENSE
71-
%doc NEWS.txt
72-
%{python3_sitelib}/beautifulsoup4-%{version}*.egg-info
100+
%doc NEWS.txt CHANGELOG
101+
%{python3_sitelib}/beautifulsoup4-%{version}.dist-info/
73102
%{python3_sitelib}/bs4
74103

75104
%changelog
76-
* Wed Mar 08 2023 Sumedh Sharma <sumsharma@microsoft.com> - 4.11.2-2
77-
- Initial CBL-Mariner import from Fedora 38 (license: MIT)
78-
- license verified
105+
* Fri Mar 21 2025 Jyoti kanase <v-jykanase@microsoft.com> - 4.12.3-8
106+
- Initial Azure Linux import from Fedora 41 (license: MIT).
107+
- License verified.
108+
109+
* Tue Aug 13 2024 Lumír Balhar <lbalhar@redhat.com> - 4.12.3-7
110+
- Fix compatibility with lxml 5.3.0
111+
112+
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 4.12.3-6
113+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
114+
115+
* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 4.12.3-5
116+
- Rebuilt for Python 3.13
117+
118+
* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 4.12.3-4
119+
- Bootstrap for Python 3.13
120+
121+
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 4.12.3-3
122+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
123+
124+
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 4.12.3-2
125+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
126+
127+
* Wed Jan 17 2024 Terje Rosten <terje.rosten@ntnu.no> - 4.12.3-1
128+
- 4.12.3
129+
130+
* Sat Dec 16 2023 Terje Rosten <terje.rosten@ntnu.no> - 4.12.2-5
131+
- Add patch from upstream to fix test issue with libxml2 2.12.1 (bz#2251911)
132+
133+
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 4.12.2-4
134+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
135+
136+
* Fri Jun 16 2023 Python Maint <python-maint@redhat.com> - 4.12.2-3
137+
- Rebuilt for Python 3.12
138+
139+
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 4.12.2-2
140+
- Bootstrap for Python 3.12
141+
142+
* Thu Apr 13 2023 Terje Rosten <terje.rosten@ntnu.no> - 4.12.2-1
143+
- 4.12.2
144+
145+
* Mon Mar 20 2023 Terje Rosten <terje.rosten@ntnu.no> - 4.12.0-1
146+
- 4.12.0
79147

80148
* Thu Feb 02 2023 Terje Rosten <terje.rosten@ntnu.no> - 4.11.2-1
81149
- 4.11.2
@@ -285,3 +353,4 @@ python3 -m unittest discover -s bs4 || :
285353

286354
* Sat Mar 24 2012 Terje Rosten <terje.rosten@ntnu.no> - 4.0.1-1
287355
- initial package based on python-BeautifulSoup.
356+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
From 9786a62726de5a8caba10021c4d4a58c8a3e9e3f Mon Sep 17 00:00:00 2001
2+
From: Leonard Richardson <leonardr@segfault.org>
3+
Date: Wed, 21 Aug 2024 20:18:33 -0400
4+
Subject: * Changes to make tests work whether tests are run under soupsieve
5+
2.6 or an earlier version. Based on a patch by Stefano Rivera.
6+
7+
---
8+
bs4/tests/test_css.py | 13 +++++++++++--
9+
1 files changed, 11 insertions(+), 2 deletions(-)
10+
11+
diff --git a/bs4/tests/test_css.py b/bs4/tests/test_css.py
12+
index 359dbcd..3c2318b 100644
13+
--- a/bs4/tests/test_css.py
14+
+++ b/bs4/tests/test_css.py
15+
@@ -8,14 +8,23 @@ from bs4 import (
16+
ResultSet,
17+
)
18+
19+
+from packaging.version import Version
20+
+
21+
from . import (
22+
SoupTest,
23+
SOUP_SIEVE_PRESENT,
24+
)
25+
26+
if SOUP_SIEVE_PRESENT:
27+
- from soupsieve import SelectorSyntaxError
28+
+ from soupsieve import __version__, SelectorSyntaxError
29+
30+
+ # Some behavior changes in soupsieve 2.6 that affects one of our
31+
+ # tests. For the test to run under all versions of Python
32+
+ # supported by Beautiful Soup (which includes versions of Python
33+
+ # not supported by soupsieve 2.6) we need to check both behaviors.
34+
+ SOUPSIEVE_EXCEPTION_ON_UNSUPPORTED_PSEUDOCLASS = SelectorSyntaxError
35+
+ if Version(__version__) < Version("2.6"):
36+
+ SOUPSIEVE_EXCEPTION_ON_UNSUPPORTED_PSEUDOCLASS = NotImplementedError
37+
38+
@pytest.mark.skipif(not SOUP_SIEVE_PRESENT, reason="Soup Sieve not installed")
39+
class TestCSSSelectors(SoupTest):
40+
@@ -332,7 +341,7 @@ class TestCSSSelectors(SoupTest):
41+
assert "yes" == chosen.string
42+
43+
def test_unsupported_pseudoclass(self):
44+
- with pytest.raises(NotImplementedError):
45+
+ with pytest.raises(SOUPSIEVE_EXCEPTION_ON_UNSUPPORTED_PSEUDOCLASS):
46+
self.soup.select("a:no-such-pseudoclass")
47+
48+
with pytest.raises(SelectorSyntaxError):

cgmanifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22123,8 +22123,8 @@
2212322123
"type": "other",
2212422124
"other": {
2212522125
"name": "python-beautifulsoup4",
22126-
"version": "4.11.2",
22127-
"downloadUrl": "https://files.pythonhosted.org/packages/source/b/beautifulsoup4/beautifulsoup4-4.11.2.tar.gz"
22126+
"version": "4.12.3",
22127+
"downloadUrl": "https://files.pythonhosted.org/packages/source/b/beautifulsoup4/beautifulsoup4-4.12.3.tar.gz"
2212822128
}
2212922129
}
2213022130
},

0 commit comments

Comments
 (0)