The package rpms/python-databases.git has added or updated architecture specific content
in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/python-databases.git/commit/?id=a....
Change:
+%ifnarch %{ix86} %{arm32}
Thanks.
Full change:
============
commit ad864701a3009edc054288e283281eebe9c52310
Author: Benjamin A. Beasley <code(a)musicinmybrain.net>
Date: Fri Mar 4 08:29:43 2022 -0500
Work around asyncmy 32-bit ExcludeArch
diff --git a/python-databases.spec b/python-databases.spec
index 60c5212..0f4b6ce 100644
--- a/python-databases.spec
+++ b/python-databases.spec
@@ -15,7 +15,16 @@ URL:
https://www.encode.io/databases/
%global forgeurl
https://github.com/encode/databases
Source0: %{forgeurl}/archive/%{version}/databases-%{version}.tar.gz
-BuildArch: noarch
+# This package contains no compiled code and should be inherently noarch, but
+# the asyncmy dependency for the mysql_asyncmy/mysql+asyncmy extra is
+# ExcludeArch on 32-bit platforms (RHBZ#2060899), which unfortunately means
+# this package as a whole must be archful in order to drop that extra on the
+# affected platforms. We can still make the binary RPMs noarch, except for the
+# affected extra metapackage.
+%global debug_package %{nil}
+%ifnarch %{ix86} %{arm32}
+%global with_asyncmy 1
+%endif
BuildRequires: python3-devel
@@ -67,13 +76,27 @@ Community:
https://discuss.encode.io/c/databases}
# rpm -E '%%pyproject_extras_subpkg -n python3-databases postgresql …'
# to see the proper macro expanson (but note that the absolute path to
# %%{_pyproject_ghost_distinfo} must be fixed). We can still handle SQLite the
-# easy way.
-%pyproject_extras_subpkg -n python3-databases sqlite
+# easy way—but we don’t, because it would inherit the archfulness of the base
+# package, and we want it to be noarch.
+%package -n python3-databases+sqlite
+Summary: Metapackage for python3-databases: sqlite extras
+
+BuildArch: noarch
+
+Requires: python3-databases = %{version}-%{release}
+
+%description -n python3-databases+sqlite
+This is a metapackage bringing in sqlite extras requires for
+python3-databases. It makes sure the dependencies are installed.
+
+%files -n python3-databases+sqlite -f %{_pyproject_ghost_distinfo}
%package -n python3-databases+postgresql
Summary: Metapackage for python3-databases: postgresql extras
+BuildArch: noarch
+
Requires: python3-databases = %{version}-%{release}
Recommends: python3dist(psycopg2)
@@ -84,6 +107,7 @@ python3-databases. It makes sure the dependencies are installed.
%files -n python3-databases+postgresql -f %{_pyproject_ghost_distinfo}
+%if 0%{?with_asyncmy}
%package -n python3-databases+mysql_asyncmy
Summary: Metapackage for python3-databases: mysql_asyncmy extras
Recommends: python3dist(pymysql)
@@ -98,11 +122,14 @@ This is a metapackage bringing in mysql_asyncmy extras requires for
python3-databases. It makes sure the dependencies are installed.
%files -n python3-databases+mysql_asyncmy -f %{_pyproject_ghost_distinfo}
+%endif
%package -n python3-databases+postgresql_aiopg
Summary: Metapackage for python3-databases: postgresql_aiopg extras
+BuildArch: noarch
+
Requires: python3-databases = %{version}-%{release}
Recommends: python3dist(psycopg2)
@@ -116,6 +143,8 @@ python3-databases. It makes sure the dependencies are installed.
%package -n python3-databases
Summary: %{summary}
+BuildArch: noarch
+
Obsoletes: python-databases-doc < 0.5.2-4
%description -n python3-databases %{common_description}
@@ -123,10 +152,16 @@ Obsoletes: python-databases-doc < 0.5.2-4
%prep
%autosetup -n databases-%{version} -p1
+%if !0%{?with_asyncmy}
+sed -r -i \
+ -e 's/^([[:blank:]]*)(.*import AsyncMyBackend.*)$/# \1\2\n\1pass/' \
+ -e 's/^def test_asyncmy_.*$/(a)pytest.mark.skip("asyncmy does not support
32-bit")\n&/' \
+ tests/test_connection_options.py
+%endif
%generate_buildrequires
-%pyproject_buildrequires -x postgresql,mysql_asyncmy,sqlite,postgresql_aiopg
+%pyproject_buildrequires -x
postgresql,%{?with_asyncmy:mysql_asyncmy,}sqlite,postgresql_aiopg
%build
@@ -151,6 +186,10 @@ touch tests/__init__.py
# user. The following environment variable is a comma-separated list.
export TEST_DATABASE_URLS="sqlite:///testsuite, sqlite+aiosqlite:///testsuite"
+%if 0%{?with_asyncmy}
+# Currently, asyncmy is the only MySQL backend supported on Python 3.10+, so
+# there is no need to start a MySQL/MariaDB daemon on architectures where it is
+# not available.
%if %{with mysql_tests}
# Based on rubygem-mysql2 packaging; see also python-asyncmy
@@ -194,19 +233,21 @@ mysql -u 'root' --password='123456' \
--protocol='TCP' -h 'localhost' -P "${MYSQL_PORT}" \
-e 'CREATE DATABASE testsuite;'
+# Since we the “mysql” extra/backend is not supported on Python 3.10, we should
+# not attempt to test mysql:// URLs, only mysql+…//.
for url in \
- "mysql://root:123456@localhost:${MYSQL_PORT}/testsuite" \
"mysql+asyncmy://root:123456@localhost:${MYSQL_PORT}/testsuite"
do
export TEST_DATABASE_URLS="${TEST_DATABASE_URLS}, ${url}"
done
%endif
+%endif
%pytest --verbose
# Since we can’t test all backends, at least do an import “smoke test,” but
# note that the “mysql” extra/backend is not supported, so we must exclude it.
-%pyproject_check_import -e 'databases.backends.mysql'
+%pyproject_check_import -e 'databases.backends.mysql' %{?!with_asyncmy:-e
'databases.backends.asyncmy'}
%files -n python3-databases -f %{pyproject_files}
commit b01eda65b4b999d41e5ef48d3b50a54c65c453e9
Author: Benjamin A. Beasley <code(a)musicinmybrain.net>
Date: Fri Mar 4 08:10:05 2022 -0500
Do not patch in sqlalchemy[asyncio] extra dependency
See
https://bugzilla.redhat.com/show_bug.cgi?id=2012590; we just need
sqlalchemy >= 1.4.26, which is satisfied where we will package this
version of databases (F36+), and also in F35.
diff --git a/databases-0.5.5-pr-470.patch b/databases-0.5.5-pr-470.patch
deleted file mode 100644
index 249e8c3..0000000
--- a/databases-0.5.5-pr-470.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur databases-0.5.5-original/setup.py databases-0.5.5/setup.py
---- databases-0.5.5-original/setup.py 2022-01-20 16:14:37.000000000 -0500
-+++ databases-0.5.5/setup.py 2022-03-03 10:50:57.176276169 -0500
-@@ -47,7 +47,7 @@
- author_email="tom(a)tomchristie.com",
- packages=get_packages("databases"),
- package_data={"databases": ["py.typed"]},
-- install_requires=["sqlalchemy>=1.4,<1.5",
'aiocontextvars;python_version<"3.7"'],
-+ install_requires=["sqlalchemy[asyncio]>=1.4,<1.5",
'aiocontextvars;python_version<"3.7"'],
- extras_require={
- "postgresql": ["asyncpg"],
- "mysql": ["aiomysql"],
diff --git a/python-databases.spec b/python-databases.spec
index 00a9907..60c5212 100644
--- a/python-databases.spec
+++ b/python-databases.spec
@@ -15,13 +15,6 @@ URL:
https://www.encode.io/databases/
%global forgeurl
https://github.com/encode/databases
Source0: %{forgeurl}/archive/%{version}/databases-%{version}.tar.gz
-# Dependency on sqlalchemy should include asyncio extra
-#
https://github.com/encode/databases/issues/469
-# Depend on sqlalchemy[asyncio] instead of just sqlalchemy
-#
https://github.com/encode/databases/pull/470
-# (rebased to 0.5.5)
-Patch0: databases-0.5.5-pr-470.patch
-
BuildArch: noarch
BuildRequires: python3-devel