Add bcond flags to disable optional cirucular deps

New bcond flag to disable/enable soupsieve dependency
New bcond flag to disable/enable testing
Test module loading in check section
This commit is contained in:
Steve Traylen 2022-02-08 19:59:07 +00:00
parent aa4bafadd6
commit ee9be21d72

View File

@ -1,10 +1,14 @@
# Ciruclar dependency with soupsieve which must be disabled at times
%bcond_without soupsieve
%bcond_without tests
%if 0%{?fedora} < 32 && 0%{?rhel} < 8 %if 0%{?fedora} < 32 && 0%{?rhel} < 8
%global py2 1 %global py2 1
%endif %endif
Name: python-beautifulsoup4 Name: python-beautifulsoup4
Version: 4.10.0 Version: 4.10.0
Release: 2%{?dist} Release: 3%{?dist}
Summary: HTML/XML parser for quick-turnaround applications like screen-scraping Summary: HTML/XML parser for quick-turnaround applications like screen-scraping
License: MIT License: MIT
URL: http://www.crummy.com/software/BeautifulSoup/ URL: http://www.crummy.com/software/BeautifulSoup/
@ -13,18 +17,26 @@ BuildArch: noarch
%if 0%{?py2} %if 0%{?py2}
BuildRequires: python2-devel >= 2.7 BuildRequires: python2-devel >= 2.7
# html5lib BR just for test coverage # html5lib BR just for test coverage
%if %{with tests}
BuildRequires: python2-html5lib BuildRequires: python2-html5lib
%endif
BuildRequires: python2-setuptools BuildRequires: python2-setuptools
%if %{with soupsieve}
BuildRequires: python2-soupsieve BuildRequires: python2-soupsieve
%endif
BuildRequires: python2-lxml BuildRequires: python2-lxml
BuildRequires: /usr/bin/2to3 BuildRequires: /usr/bin/2to3
BuildRequires: python2-tools BuildRequires: python2-tools
%endif %endif
# html5lib BR just for test coverage # html5lib BR just for test coverage
%if %{with tests}
BuildRequires: python3-html5lib BuildRequires: python3-html5lib
%endif
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
%if %{with soupsieve}
BuildRequires: python3-soupsieve BuildRequires: python3-soupsieve
%endif
BuildRequires: python3-lxml BuildRequires: python3-lxml
%global _description %{expand: %global _description %{expand:
@ -52,7 +64,9 @@ minutes with Beautiful Soup.}
%package -n python2-beautifulsoup4 %package -n python2-beautifulsoup4
Summary: %summary Summary: %summary
Requires: python2-lxml Requires: python2-lxml
%if %{with soupsieve}
Requires: python2-soupsieve Requires: python2-soupsieve
%endif
%{?python_provide:%python_provide python2-beautifulsoup4} %{?python_provide:%python_provide python2-beautifulsoup4}
%description -n python2-beautifulsoup4 %_description %description -n python2-beautifulsoup4 %_description
@ -61,7 +75,9 @@ Requires: python2-soupsieve
%package -n python3-beautifulsoup4 %package -n python3-beautifulsoup4
Summary: %summary Summary: %summary
Requires: python3-lxml Requires: python3-lxml
%if %{with soupsieve}
Requires: python3-soupsieve Requires: python3-soupsieve
%endif
Obsoletes: python3-BeautifulSoup < 1:3.2.1-2 Obsoletes: python3-BeautifulSoup < 1:3.2.1-2
%{?python_provide:%python_provide python3-beautifulsoup4} %{?python_provide:%python_provide python3-beautifulsoup4}
@ -83,9 +99,13 @@ pushd %{py3dir}
%{py3_install} %{py3_install}
%check %check
%py3_check_import bs4
%if %{with tests}
%{?py2:%{__python2} -m unittest discover -s bs4 || : } %{?py2:%{__python2} -m unittest discover -s bs4 || : }
pushd %{py3dir} pushd %{py3dir}
%{__python3} -m unittest discover -s bs4 || : %{__python3} -m unittest discover -s bs4 || :
%endif
%if 0%{?py2} %if 0%{?py2}
%files -n python2-beautifulsoup4 %files -n python2-beautifulsoup4
@ -102,6 +122,11 @@ pushd %{py3dir}
%{python3_sitelib}/bs4 %{python3_sitelib}/bs4
%changelog %changelog
* Tue Feb 08 2022 Steve Traylen <steve.traylen@cern.ch> - 4.10.0-3
- New bcond flag to disable/enable soupsieve dependency
- New bcond flag to disable/enable testing
- Test module loading in check section
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 4.10.0-2 * Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 4.10.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild