From 9354f348b3d0c608bf0b5f35b446da3f9273ceac Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Mon, 12 Feb 2024 09:26:53 -0500 Subject: [PATCH] Disable all extras in RHEL builds The vast majority of these extras require dependencies not available in RHEL. Disabling them does not affect the ability to use the packages with those dependencies installed from a different source, but it does avoid the unwanted build dependencies. --- python-sqlalchemy.spec | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/python-sqlalchemy.spec b/python-sqlalchemy.spec index 93b2e6e..fb1d53d 100644 --- a/python-sqlalchemy.spec +++ b/python-sqlalchemy.spec @@ -3,7 +3,7 @@ # The asyncmy Python package isn’t available in x86 (32bit) %ifnarch %ix86 -%bcond asyncmy 1 +%bcond asyncmy %{undefined rhel} %else %bcond asyncmy 0 %endif @@ -14,6 +14,7 @@ %global srcname SQLAlchemy %global canonicalname %{py_dist_name %{srcname}} +%if %{undefined rhel} %global python_pkg_extras \ asyncio \ mssql_pymssql \ @@ -29,6 +30,7 @@ aioodbc \ aiosqlite \ %{?with_asyncmy:asyncmy} +%endif Name: python-%{canonicalname} Version: 2.0.26 @@ -46,9 +48,6 @@ BuildRequires: findutils BuildRequires: gcc BuildRequires: python3-devel >= 3.7 # The dependencies needed for testing don’t get auto-generated. -%if %{with mypy} -BuildRequires: python3dist(mypy) -%endif BuildRequires: python3dist(pytest) %if %{with xdist} BuildRequires: python3dist(pytest-xdist) @@ -78,8 +77,10 @@ as you choose, determining relationships based on foreign keys or letting you define the join conditions explicitly, to bridge the gap between database and domain. +%if %{undefined rhel} # Subpackages to ensure dependencies enabling extra functionality %pyproject_extras_subpkg -n python3-sqlalchemy %python_pkg_extras +%endif %package doc Summary: Documentation for SQLAlchemy @@ -90,7 +91,7 @@ Documentation for SQLAlchemy. %generate_buildrequires -%pyproject_buildrequires -x %{gsub %{quote:%python_pkg_extras} %%s+ ,} +%pyproject_buildrequires %{!?rhel:-x %{gsub %{quote:%python_pkg_extras} %%s+ ,}} %prep