Define a buildrequire_extras %bcond for bootstrapping

This commit is contained in:
Miro Hrončok 2022-09-19 19:30:51 +02:00
parent 8cd3405121
commit 9c1438f59e
1 changed files with 11 additions and 1 deletions

View File

@ -21,6 +21,16 @@ BuildRequires: libxml2-devel
BuildRequires: libxslt-devel
BuildRequires: python3-devel
# It is a good idea to BuildRequire the runtime requirements of the [extras] we build.
# That way, we ensure all the [extras] we build are installable,
# and we possibly run tests that would otherwise be skipped.
# However, some of the extras here create a dependency loop.
# - [cssselect] Requires cssselect BuildRequires lxml
# - [html5] Requires html5lib BuildRequires lxml
# - [htmlsoup] Requires beautifulsoup4 Requires lxml
# Hence we provide a bcond to disable this buildtime requirement.
%bcond buildrequire_extras 1
%global _description \
lxml is a Pythonic, mature binding for the libxml2 and libxslt libraries. It\
provides safe and convenient access to these libraries using the ElementTree It\
@ -45,7 +55,7 @@ Python 3 version.
%autosetup -n lxml-%{version} -p1
%generate_buildrequires
%pyproject_buildrequires -x source,cssselect,html5,htmlsoup
%pyproject_buildrequires -x source%{?with_buildrequire_extras:,cssselect,html5,htmlsoup}
# Remove pregenerated Cython C sources
# We need to do this after %%pyproject_buildrequires because setup.py errors
# without Cython and without the .c files.