summaryrefslogtreecommitdiff
path: root/dev-python/sqlalchemy/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-11-25 22:39:15 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-11-25 22:39:15 +0000
commitd934827bf44b7cfcf6711964418148fa60877668 (patch)
tree0625f358789b5e015e49db139cc1dbc9be00428f /dev-python/sqlalchemy/files
parent2e34d110f164bf74d55fced27fe0000201b3eec5 (diff)
gentoo resync : 25.11.2020
Diffstat (limited to 'dev-python/sqlalchemy/files')
-rw-r--r--dev-python/sqlalchemy/files/sqlalchemy-1.3.20-pypy3.patch188
-rw-r--r--dev-python/sqlalchemy/files/sqlalchemy-pytest-deprecation.patch67
2 files changed, 188 insertions, 67 deletions
diff --git a/dev-python/sqlalchemy/files/sqlalchemy-1.3.20-pypy3.patch b/dev-python/sqlalchemy/files/sqlalchemy-1.3.20-pypy3.patch
new file mode 100644
index 000000000000..3455534eb35d
--- /dev/null
+++ b/dev-python/sqlalchemy/files/sqlalchemy-1.3.20-pypy3.patch
@@ -0,0 +1,188 @@
+commit 1607c5c19f8ef362be7182b0ee0fddc6a3d3140e
+Author: Federico Caselli <cfederico87@gmail.com>
+Date: Sat Apr 18 18:10:59 2020 +0200
+
+ Enable pypy tests on github workflow
+
+ Fixes: #5223
+ Change-Id: I0952e54ed9af2952ea340be1945311376ffc1ad2
+
+diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py
+index 6f3170a9e..0427eeac5 100644
+--- a/lib/sqlalchemy/orm/mapper.py
++++ b/lib/sqlalchemy/orm/mapper.py
+@@ -1326,7 +1326,7 @@ class Mapper(InspectionAttr):
+ if key == "__init__" and hasattr(method, "_sa_original_init"):
+ method = method._sa_original_init
+ if isinstance(method, types.MethodType):
+- method = method.im_func
++ method = method.__func__
+ if isinstance(method, types.FunctionType):
+ if hasattr(method, "__sa_reconstructor__"):
+ self._reconstructor = method
+diff --git a/lib/sqlalchemy/testing/plugin/pytestplugin.py b/lib/sqlalchemy/testing/plugin/pytestplugin.py
+index ad4ebb656..dc47f671e 100644
+--- a/lib/sqlalchemy/testing/plugin/pytestplugin.py
++++ b/lib/sqlalchemy/testing/plugin/pytestplugin.py
+@@ -340,7 +340,7 @@ def %(name)s(%(args)s):
+ code, {"target": target, "fn": fn}, fn.__name__
+ )
+ if not add_positional_parameters:
+- decorated.__defaults__ = getattr(fn, "im_func", fn).__defaults__
++ decorated.__defaults__ = getattr(fn, "__func__", fn).__defaults__
+ decorated.__wrapped__ = fn
+ return update_wrapper(decorated, fn)
+ else:
+diff --git a/lib/sqlalchemy/util/langhelpers.py b/lib/sqlalchemy/util/langhelpers.py
+index 7de16bcdf..e256d7764 100644
+--- a/lib/sqlalchemy/util/langhelpers.py
++++ b/lib/sqlalchemy/util/langhelpers.py
+@@ -151,7 +151,7 @@ def %(name)s(%(args)s):
+ decorated = _exec_code_in_env(
+ code, {targ_name: target, fn_name: fn}, fn.__name__
+ )
+- decorated.__defaults__ = getattr(fn, "im_func", fn).__defaults__
++ decorated.__defaults__ = getattr(fn, "__func__", fn).__defaults__
+ decorated.__wrapped__ = fn
+ return update_wrapper(decorated, fn)
+
+@@ -751,7 +751,7 @@ def monkeypatch_proxied_specials(
+ fn = getattr(from_cls, method)
+ if not hasattr(fn, "__call__"):
+ continue
+- fn = getattr(fn, "im_func", fn)
++ fn = getattr(fn, "__func__", fn)
+ except AttributeError:
+ continue
+ try:
+diff --git a/test/base/test_utils.py b/test/base/test_utils.py
+index 8356de61b..c04dea7cd 100644
+--- a/test/base/test_utils.py
++++ b/test/base/test_utils.py
+@@ -411,7 +411,8 @@ class WrapCallableTest(fixtures.TestBase):
+ lambda: my_functools_default(), my_functools_default
+ )
+ eq_(c.__name__, "partial")
+- eq_(c.__doc__, my_functools_default.__call__.__doc__)
++ if not compat.pypy: # pypy fails this check
++ eq_(c.__doc__, my_functools_default.__call__.__doc__)
+ eq_(c(), 5)
+
+
+diff --git a/test/engine/test_logging.py b/test/engine/test_logging.py
+index fe4ff44a7..e14c3a37d 100644
+--- a/test/engine/test_logging.py
++++ b/test/engine/test_logging.py
+@@ -8,6 +8,7 @@ from sqlalchemy import or_
+ from sqlalchemy import select
+ from sqlalchemy import String
+ from sqlalchemy import Table
++from sqlalchemy import testing
+ from sqlalchemy import util
+ from sqlalchemy.sql import util as sql_util
+ from sqlalchemy.testing import assert_raises_message
+@@ -460,10 +461,12 @@ class PoolLoggingTest(fixtures.TestBase):
+ q = self._stpool_logging_fixture()
+ self._test_queuepool(q, False)
+
++ @testing.requires.predictable_gc
+ def test_queuepool_echo(self):
+ q = self._queuepool_echo_fixture()
+ self._test_queuepool(q)
+
++ @testing.requires.predictable_gc
+ def test_queuepool_logging(self):
+ q = self._queuepool_logging_fixture()
+ self._test_queuepool(q)
+diff --git a/test/engine/test_pool.py b/test/engine/test_pool.py
+index 3b989959e..c8cd89555 100644
+--- a/test/engine/test_pool.py
++++ b/test/engine/test_pool.py
+@@ -608,6 +608,7 @@ class PoolEventsTest(PoolTestBase):
+ assert canary.call_args_list[0][0][0] is dbapi_con
+ assert canary.call_args_list[0][0][2] is exc
+
++ @testing.requires.predictable_gc
+ def test_checkin_event_gc(self):
+ p, canary = self._checkin_event_fixture()
+
+diff --git a/test/orm/test_deferred.py b/test/orm/test_deferred.py
+index f8817bbd7..2bf466c15 100644
+--- a/test/orm/test_deferred.py
++++ b/test/orm/test_deferred.py
+@@ -1700,6 +1700,8 @@ class WithExpressionTest(fixtures.DeclarativeMappedTest):
+ c1 = s.query(C).order_by(C.id)
+ eq_(c1.all(), [C(c_expr=1), C(c_expr=1)])
+
++ s.expunge_all()
++
+ c2 = (
+ s.query(C)
+ .options(with_expression(C.c_expr, C.x * 2))
+
+commit 8d3ac81a8794bdd3532ad07427edf9f48493919d
+Date: Wed Oct 14 18:25:45 2020 +0200
+
+ Skip a failing test that got removed in master
+
+ https://github.com/sqlalchemy/sqlalchemy/commit/a9b068ae564e5e775e312373088545b75aeaa1b0
+
+diff --git a/test/orm/test_deprecations.py b/test/orm/test_deprecations.py
+index 156898f..0d6dc72 100644
+--- a/test/orm/test_deprecations.py
++++ b/test/orm/test_deprecations.py
+@@ -560,7 +560,7 @@ class StrongIdentityMapTest(_fixtures.FixtureTest):
+ def test_prune_imap(self):
+ self._test_prune(self._strong_ident_fixture)
+
+- def test_prune_events(self):
++ def _test_prune_events(self):
+ self._test_prune(self._event_fixture)
+
+ @testing.fails_if(lambda: pypy, "pypy has a real GC")
+
+commit 1a1cc0e623698a75274f1525d2d14464ff738b86
+Date: Wed Oct 14 18:28:56 2020 +0200
+
+ Fix PyPy-related tests
+
+ Partial backport of https://github.com/sqlalchemy/sqlalchemy/commit/9e31fc74089cf565df5f275d22eb8ae5414d6e45
+
+diff --git a/test/base/test_utils.py b/test/base/test_utils.py
+diff --git a/test/base/test_utils.py b/test/base/test_utils.py
+index 8356de61b..c3d25b824 100644
+--- a/test/base/test_utils.py
++++ b/test/base/test_utils.py
+@@ -1725,7 +1725,7 @@ class ArgInspectionTest(fixtures.TestBase):
+
+ assert_raises(TypeError, get_callable_argspec, datetime.datetime.now)
+
+- @fails_if(lambda: util.pypy, "pypy returns plain *arg, **kw")
++ @testing.requires.cpython
+ def test_callable_argspec_obj_init(self):
+ assert_raises(TypeError, get_callable_argspec, object)
+
+@@ -2154,10 +2154,7 @@ class TestFormatArgspec(_Py3KFixtures, fixtures.TestBase):
+ grouped=False,
+ )
+
+- @testing.fails_if(
+- lambda: util.pypy,
+- "pypy doesn't report Obj.__init__ as object.__init__",
+- )
++ @testing.requires.cpython
+ def test_init_grouped(self):
+ object_spec = {
+ "args": "(self)",
+@@ -2181,10 +2178,7 @@ class TestFormatArgspec(_Py3KFixtures, fixtures.TestBase):
+ self._test_init(None, object_spec, wrapper_spec, custom_spec)
+ self._test_init(True, object_spec, wrapper_spec, custom_spec)
+
+- @testing.fails_if(
+- lambda: util.pypy,
+- "pypy doesn't report Obj.__init__ as object.__init__",
+- )
++ @testing.requires.cpython
+ def test_init_bare(self):
+ object_spec = {
+ "args": "self",
diff --git a/dev-python/sqlalchemy/files/sqlalchemy-pytest-deprecation.patch b/dev-python/sqlalchemy/files/sqlalchemy-pytest-deprecation.patch
deleted file mode 100644
index ee09a7312e6a..000000000000
--- a/dev-python/sqlalchemy/files/sqlalchemy-pytest-deprecation.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From 993e6449e3f5f3532f6f5426b824718435ce6c6d Mon Sep 17 00:00:00 2001
-From: Mike Bayer <mike_mp@zzzcomputing.com>
-Date: Thu, 12 Mar 2020 19:44:37 -0400
-Subject: [PATCH] Dont raise on pytest deprecation warnings
-
-py.test 5.4.0 emits deprecation warnings for pytest.Class.
-make sure we don't raise for these, and log the code that will
-be used for 5.4.0 when we bump requirements.
-
-Fixes: #5201
-Change-Id: I83e0402c4a6b2365a63b58d052c6989df3a37328
----
- lib/sqlalchemy/testing/plugin/pytestplugin.py | 13 +++++++++++++
- lib/sqlalchemy/testing/warnings.py | 9 +++++++++
- 3 files changed, 29 insertions(+)
-
-diff --git a/lib/sqlalchemy/testing/plugin/pytestplugin.py b/lib/sqlalchemy/testing/plugin/pytestplugin.py
-index c39f9f32e..f2e7d706f 100644
---- a/lib/sqlalchemy/testing/plugin/pytestplugin.py
-+++ b/lib/sqlalchemy/testing/plugin/pytestplugin.py
-@@ -160,6 +160,11 @@ def pytest_collection_modifyitems(session, config, items):
- if sub_cls is not test_class.cls:
- per_cls_dict = rebuilt_items[test_class.cls]
-
-+ # in pytest 5.4.0
-+ # for inst in pytest.Class.from_parent(
-+ # test_class.parent.parent, name=sub_cls.__name__
-+ # ).collect():
-+
- for inst in pytest.Class(
- sub_cls.__name__, parent=test_class.parent.parent
- ).collect():
-@@ -188,6 +193,14 @@ def pytest_collection_modifyitems(session, config, items):
- def pytest_pycollect_makeitem(collector, name, obj):
-
- if inspect.isclass(obj) and plugin_base.want_class(name, obj):
-+
-+ # in pytest 5.4.0
-+ # return [
-+ # pytest.Class.from_parent(collector,
-+ # name=parametrize_cls.__name__)
-+ # for parametrize_cls in _parametrize_cls(collector.module, obj)
-+ # ]
-+
- return [
- pytest.Class(parametrize_cls.__name__, parent=collector)
- for parametrize_cls in _parametrize_cls(collector.module, obj)
-diff --git a/lib/sqlalchemy/testing/warnings.py b/lib/sqlalchemy/testing/warnings.py
-index cc11e556c..6b42c98cb 100644
---- a/lib/sqlalchemy/testing/warnings.py
-+++ b/lib/sqlalchemy/testing/warnings.py
-@@ -34,6 +34,15 @@ def setup_filters():
- # ignore 2.0 warnings unless we are explicitly testing for them
- warnings.filterwarnings("ignore", category=sa_exc.RemovedIn20Warning)
-
-+ try:
-+ import pytest
-+ except ImportError:
-+ pass
-+ else:
-+ warnings.filterwarnings(
-+ "once", category=pytest.PytestDeprecationWarning
-+ )
-+
-
- def assert_warnings(fn, warning_msgs, regex=False):
- """Assert that each of the given warnings are emitted by fn.