diff --git a/0001-fix-build-for-pytest.patch b/0001-fix-build-for-pytest.patch index 3b8b3c0501f7a8d226b49debf9993a46907b1729..515fdb253a80e8077367127c7a709a1493f53d1c 100644 --- a/0001-fix-build-for-pytest.patch +++ b/0001-fix-build-for-pytest.patch @@ -1,46 +1,40 @@ -From c9dc9e3bc42fa2342198017334a973bc1678f50d Mon Sep 17 00:00:00 2001 -From: baizg1107 -Date: Tue, 12 Jan 2021 11:48:13 +0800 -Subject: [PATCH] fix build for pytest +From 6cb646893426c23a977908d0eb93d33371195cf5 Mon Sep 17 00:00:00 2001 +From: wangxiyuan +Date: Thu, 28 Jan 2021 09:42:28 +0800 +Subject: [PATCH] Fix build for py test +pytest has removed support for pytest.Class().collect() +and we need to use from_parent. --- - lib/sqlalchemy/testing/plugin/pytestplugin.py | 13 +++++++------ - 1 file changed, 7 insertions(+), 6 deletions(-) + lib/sqlalchemy/testing/plugin/pytestplugin.py | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/sqlalchemy/testing/plugin/pytestplugin.py b/lib/sqlalchemy/testing/plugin/pytestplugin.py -index da682ea..acb9145 100644 +index 6e958ab5e..708cf16dc 100644 --- a/lib/sqlalchemy/testing/plugin/pytestplugin.py +++ b/lib/sqlalchemy/testing/plugin/pytestplugin.py -@@ -123,10 +123,9 @@ def pytest_collection_modifyitems(session, config, items): - test_class.cls, test_class.parent.module): +@@ -162,8 +162,9 @@ def pytest_collection_modifyitems(session, config, items): if sub_cls is not test_class.cls: - list_ = rebuilt_items[test_class.cls] -- -- for inst in pytest.Class( -- sub_cls.__name__, -- parent=test_class.parent.parent).collect(): -+ for inst in pytest.Class.from_parent( -+ parent=test_class.parent.parent, -+ name=sub_cls.__name__).collect(): - list_.extend(inst.collect()) - - newitems = [] -@@ -148,11 +147,13 @@ def pytest_collection_modifyitems(session, config, items): + per_cls_dict = rebuilt_items[test_class.cls] +- for inst in pytest.Class( +- sub_cls.__name__, parent=test_class.parent.parent ++ ctor = getattr(pytest.Class, "from_parent", pytest.Class) ++ for inst in ctor( ++ name=sub_cls.__name__, parent=test_class.parent.parent + ).collect(): + for t in inst.collect(): + per_cls_dict[t.name].append(t) +@@ -190,8 +191,9 @@ def pytest_collection_modifyitems(session, config, items): def pytest_pycollect_makeitem(collector, name, obj): - if inspect.isclass(obj) and plugin_base.want_class(obj): -- return pytest.Class(name, parent=collector) -+ item = pytest.Class.from_parent(parent=collector, name=name, obj=obj) -+ return item - elif inspect.isfunction(obj) and \ - isinstance(collector, pytest.Instance) and \ - plugin_base.want_method(collector.cls, obj): -- return pytest.Function(name, parent=collector) -+ item = pytest.Function.from_parent(parent=collector, name=name) -+ return item - else: - return [] - --- -2.23.0 + if inspect.isclass(obj) and plugin_base.want_class(name, obj): ++ ctor = getattr(pytest.Class, "from_parent", pytest.Class) + return [ +- pytest.Class(parametrize_cls.__name__, parent=collector) ++ ctor(name=parametrize_cls.__name__, parent=collector) + for parametrize_cls in _parametrize_cls(collector.module, obj) + ] + elif ( +-- +2.23.0.windows.1 diff --git a/SQLAlchemy-1.2.11.tar.gz b/SQLAlchemy-1.3.15.tar.gz similarity index 42% rename from SQLAlchemy-1.2.11.tar.gz rename to SQLAlchemy-1.3.15.tar.gz index 5633f083de7defbea16f3be4eaccf704b70802f4..8453575d8c706a7f1ae62351081ca0adfcfc0ba6 100644 Binary files a/SQLAlchemy-1.2.11.tar.gz and b/SQLAlchemy-1.3.15.tar.gz differ diff --git a/Skip-test-on-sqlite-3.30+.patch b/Skip-test-on-sqlite-3.30+.patch deleted file mode 100644 index bce2b71fba4b75cc3f9e4105a98aeabed1691651..0000000000000000000000000000000000000000 --- a/Skip-test-on-sqlite-3.30+.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 6b5d94da84452b125f6788f0e1472b94a43ffc16 Mon Sep 17 00:00:00 2001 -From: Nils Philippsen -Date: Sat, 2 Nov 2019 17:36:50 -0400 -Subject: [PATCH] Expect ordering NULLs to work and skip nested aggregate tests - on sqlite >= 3.30. - -Fixed test failures which would occur with newer SQLite as of version 3.30 -or greater, due to their addition of nulls ordering syntax as well as new -restrictions on aggregate functions. Pull request courtesy Nils Philippsen. - -Fixes: #4920 -Closes: #4921 -Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4921 -Pull-request-sha: e18534a9045786efdaf4963515222838c62e0300 - -Change-Id: Idb2fc96e23e7cc96cf96f586208c2db561518202 ---- - doc/build/changelog/unreleased_13/4920.rst | 9 +++++++++ - test/requirements.py | 5 +++-- - 2 files changed, 12 insertions(+), 2 deletions(-) - create mode 100644 doc/build/changelog/unreleased_13/4920.rst - -diff --git a/doc/build/changelog/unreleased_13/4920.rst b/doc/build/changelog/unreleased_13/4920.rst -new file mode 100644 -index 0000000000..aabcc570b1 ---- /dev/null -+++ b/doc/build/changelog/unreleased_13/4920.rst -@@ -0,0 +1,9 @@ -+.. change:: -+ :tags: bug, tests -+ :tickets: 4920 -+ -+ Fixed test failures which would occur with newer SQLite as of version 3.30 -+ or greater, due to their addition of nulls ordering syntax as well as new -+ restrictions on aggregate functions. Pull request courtesy Nils Philippsen. -+ -+ -diff --git a/test/requirements.py b/test/requirements.py -index bd6fc8133d..42a24c3a97 100644 ---- a/test/requirements.py -+++ b/test/requirements.py -@@ -774,7 +774,8 @@ def dbapi_lastrowid(self): - @property - def nullsordering(self): - """Target backends that support nulls ordering.""" -- return fails_on_everything_except('postgresql', 'oracle', 'firebird') -+ return fails_on_everything_except("postgresql", "oracle", "firebird", -+ "sqlite >= 3.30.0") - - @property - def reflects_pk_names(self): -@@ -789,7 +790,7 @@ def nested_aggregates(self): - """target database can select an aggregate from a subquery that's - also using an aggregate""" - -- return skip_if(["mssql"]) -+ return skip_if(["mssql", "sqlite"]) - - @property - def array_type(self): diff --git a/python-sqlalchemy.spec b/python-sqlalchemy.spec index b0369e3d12a64e287dda018bb7aedb4776c9b2bf..1fb748aad5d3d7b43c191285134ad2766ac5e481 100644 --- a/python-sqlalchemy.spec +++ b/python-sqlalchemy.spec @@ -1,15 +1,14 @@ %global __provides_exclude_from ^(%{python2_sitearch}|%{python3_sitearch})/.*\\.so$ Name: python-sqlalchemy -Version: 1.2.11 -Release: 5 +Version: 1.3.15 +Release: 1 Summary: SQL toolkit and object relational mapper for Python License: MIT URL: http://www.sqlalchemy.org/ Source0: https://files.pythonhosted.org/packages/source/S/SQLAlchemy/SQLAlchemy-%{version}.tar.gz -Patch0001: Skip-test-on-sqlite-3.30+.patch -Patch0002: 0001-fix-build-for-pytest.patch +Patch0001: 0001-fix-build-for-pytest.patch BuildRequires: python3-devel python3-setuptools python3-pytest @@ -65,6 +64,9 @@ PYTHONPATH=. %{__python3} -m pytest test %doc doc examples %changelog +* Wed Jan 27 2021 wangxiyuan - 1.3.15-1 +- Bump version to 1.3.15 + * Tue Jan 12 2021 baizhonggui - 1.2.11-5 - Fix building for pytest