diff --git a/0001-filter-out-DeprecationWarnings.patch b/0001-filter-out-DeprecationWarnings.patch new file mode 100644 index 0000000..9ae58f7 --- /dev/null +++ b/0001-filter-out-DeprecationWarnings.patch @@ -0,0 +1,33 @@ +From a4b4548bb64789577aa87145acb66f41f2e55a40 Mon Sep 17 00:00:00 2001 +From: Tomas Hrnciar +Date: Wed, 26 May 2021 13:18:27 +0200 +Subject: [PATCH] filter out DeprecationWarnings + +--- + lib/sqlalchemy/testing/warnings.py | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/lib/sqlalchemy/testing/warnings.py b/lib/sqlalchemy/testing/warnings.py +index 3236ecf..37d0b81 100644 +--- a/lib/sqlalchemy/testing/warnings.py ++++ b/lib/sqlalchemy/testing/warnings.py +@@ -35,6 +35,16 @@ def setup_filters(): + category=DeprecationWarning, + message="The loop argument is deprecated", + ) ++ warnings.filterwarnings( ++ "ignore", ++ category=DeprecationWarning, ++ message="There is no current event loop", ++ ) ++ warnings.filterwarnings( ++ "ignore", ++ category=DeprecationWarning, ++ message="SelectableGroups dict interface is deprecated. Use select.", ++ ) + + # ignore things that are deprecated *as of* 2.0 :) + warnings.filterwarnings( +-- +2.31.1 + diff --git a/python-sqlalchemy.spec b/python-sqlalchemy.spec index f8306a8..5ceccd1 100644 --- a/python-sqlalchemy.spec +++ b/python-sqlalchemy.spec @@ -26,6 +26,15 @@ License: MIT URL: http://www.sqlalchemy.org/ Source0: https://files.pythonhosted.org/packages/source/S/%{srcname}/%{srcname}-%{srcversion}.tar.gz +# SQLAlchemy fails with Python 3.10.0b1 due to DeprecationWarnings treated as an error. +# There are two different warnings filtered out: +# DeprecationWarning: SelectableGroups dict interface is deprecated. Use select. +# Upstream report: https://github.com/sqlalchemy/sqlalchemy/issues/6540 +# DeprecationWarning: There is no current event loop +# Upstream report: https://github.com/sqlalchemy/sqlalchemy/issues/6537 +# Downstream report: https://bugzilla.redhat.com/show_bug.cgi?id=1959305 +Patch1: 0001-filter-out-DeprecationWarnings.patch + BuildRequires: gcc BuildRequires: python3-devel >= 3.6 BuildRequires: python3-greenlet >= 1.0 @@ -71,11 +80,12 @@ domain. This package includes the python 3 version of the module. # Subpackages to ensure dependencies enabling extra functionality -%{?python_extras_subpkg:%python_extras_subpkg -n python3-sqlalchemy -i %{python3_sitelib}/*.egg-info %python_pkg_extras} +%{?python_extras_subpkg:%python_extras_subpkg -n python3-sqlalchemy -i %{python3_sitearch}/*.egg-info %python_pkg_extras} %prep %setup -q -n %{srcname}-%{srcversion} +%patch1 -p1 # Remove flag for pytest-xdist. (python2-pytest-xdist is a removed dependency.) # (--max-worker-restart=5 would end the test run after 5 crashing tests.) @@ -91,7 +101,11 @@ sed -i -e's/\(addopts = .*\) --max-worker-restart=5/\1/' setup.cfg rm -rf doc/build %check -PYTHONPATH=. %{__python3} -m pytest test \ +# One test is disabled due to compatibility issue with Python 3.10, once it is fixed it +# can be enabled again. +# Upstream report: https://github.com/sqlalchemy/sqlalchemy/issues/6543 +# Downstream report: https://bugzilla.redhat.com/show_bug.cgi?id=1959305 +PYTHONPATH=. %{__python3} -m pytest test -k "not test_error_other_loop" \ %if %{with xdist} --numprocesses=auto %endif