+++ /dev/null
---- beautifulsoup4-4.6.0/bs4/element.py.orig 2017-05-07 14:15:39.000000000 +0200
-+++ beautifulsoup4-4.6.0/bs4/element.py 2021-01-23 20:55:10.229088076 +0100
-@@ -29,6 +29,11 @@
- class NamespacedAttribute(unicode):
-
- def __new__(cls, prefix, name, namespace=None):
-+ if not name:
-+ # This is the default namespace. Its name "has no value"
-+ # per https://www.w3.org/TR/xml-names/#defaulting
-+ name = None
-+
- if name is None:
- obj = unicode.__new__(cls, prefix)
- elif prefix is None:
Summary: beautifulsoup4 - Screen-scraping library
Summary(pl.UTF-8): beautifulsoup4 - biblioteka przechwytująca wyjście
Name: python-%{module}
-Version: 4.6.3
-Release: 4
+# keep 4.9.x here for python2 support
+Version: 4.9.3
+Release: 1
License: MIT
Group: Libraries/Python
#Source0Download: https://pypi.org/simple/beautifulsoup4/
Source0: https://files.pythonhosted.org/packages/source/b/beautifulsoup4/beautifulsoup4-%{version}.tar.gz
-# Source0-md5: a08ea866a5c508d9b4c28c4d21e05df8
+# Source0-md5: 57fd468ae3eb055f6871106e8f7813e2
Patch0: test_suite.patch
-Patch1: %{name}-lxml.patch
Patch2: %{name}-smart_quotes.patch
URL: https://www.crummy.com/software/BeautifulSoup/
BuildRequires: rpmbuild(macros) >= 1.714
%if %{with python2}
BuildRequires: python-modules >= 1:2.7
BuildRequires: python-setuptools
+BuildRequires: python-soupsieve >= 1.2
%endif
%if %{with python3}
+BuildRequires: python3-2to3 >= 1:3.2
BuildRequires: python3-modules >= 1:3.2
BuildRequires: python3-setuptools
+BuildRequires: python3-soupsieve >= 1.2
%endif
%if %{with doc}
-BuildRequires: sphinx-pdg
+BuildRequires: sphinx-pdg-2
%endif
Requires: python-modules >= 1:2.7
BuildArch: noarch
%prep
%setup -q -n beautifulsoup4-%{version}
%patch0 -p1
-%patch1 -p1
%patch2 -p1
+# no longer supported by setuptools
+%{__sed} -i -e '/use_2to3/d' setup.py
+
%build
%if %{with python2}
-%py_build %{?with_tests:test}
+%py_build
+
+%if %{with tests}
+%{__python} -m unittest discover -s bs4
+%endif
%endif
%if %{with python3}
-%py3_build %{?with_tests:test}
+%py3_build
+
+2to3-%{py3_ver} --no-diffs -n -w build-3/lib
+
+%if %{with tests}
+cd build-3/lib
+%{__python3} -m unittest discover -s bs4
+cd ../..
+%endif
%endif
%if %{with doc}
-%{__make} -C doc html
+%{__make} -C doc html \
+ SPHINXBUILD=sphinx-build-2
%endif
%install
%if %{with python2}
%py_install
+
+%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/bs4/tests
+%py_postclean
%endif
%if %{with python3}
%py3_install
+
+%{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/bs4/tests
%endif
%clean
%if %{with python2}
%files
%defattr(644,root,root,755)
-%doc AUTHORS.txt COPYING.txt NEWS.txt README.md TODO.txt
+%doc COPYING.txt NEWS.txt README.md TODO.txt
%{py_sitescriptdir}/bs4
%{py_sitescriptdir}/beautifulsoup4-%{version}-py*.egg-info
%endif
%if %{with python3}
%files -n python3-%{module}
%defattr(644,root,root,755)
-%doc AUTHORS.txt COPYING.txt NEWS.txt README.md TODO.txt
+%doc COPYING.txt NEWS.txt README.md TODO.txt
%{py3_sitescriptdir}/bs4
%{py3_sitescriptdir}/beautifulsoup4-%{version}-py*.egg-info
%endif