14
0

- Add no_decl_class_registry.patch to make the package compatible

with SQLAlchemy 1.4 (gh#chaoss/grimoirelab-sortinghat#579).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sortinghat?expand=0&rev=21
This commit is contained in:
2021-08-05 15:26:50 +00:00
committed by Git OBS Bridge
parent 13fc15ad99
commit 22daf5bfb1
3 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
---
sortinghat/db/database.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/sortinghat/db/database.py
+++ b/sortinghat/db/database.py
@@ -258,7 +258,7 @@ def reflect_table(engine, klass):
def find_model_by_table_name(name):
"""Find a model reference by its table name"""
- for model in ModelBase._decl_class_registry.values():
- if hasattr(model, '__table__') and model.__table__.fullname == name:
- return model
- return None
\ No newline at end of file
+ for value in ModelBase.registry._class_registry.values():
+ if getattr(value, '__tablename__', None) == name:
+ return value
+ return None

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Aug 5 15:20:24 UTC 2021 - Matej Cepl <mcepl@suse.com>
- Add no_decl_class_registry.patch to make the package compatible
with SQLAlchemy 1.4 (gh#chaoss/grimoirelab-sortinghat#579).
------------------------------------------------------------------- -------------------------------------------------------------------
Thu May 27 12:39:34 UTC 2021 - Matej Cepl <mcepl@suse.com> Thu May 27 12:39:34 UTC 2021 - Matej Cepl <mcepl@suse.com>

View File

@@ -29,6 +29,9 @@ License: GPL-3.0-only
Group: Development/Languages/Python Group: Development/Languages/Python
URL: https://github.com/grimoirelab/sortinghat URL: https://github.com/grimoirelab/sortinghat
Source0: https://files.pythonhosted.org/packages/source/s/sortinghat/sortinghat-%{version}.tar.gz Source0: https://files.pythonhosted.org/packages/source/s/sortinghat/sortinghat-%{version}.tar.gz
# PATCH-FIX-UPSTREAM no_decl_class_registry.patch gh#chaoss/grimoirelab-sortinghat#579 mcepl@suse.com
# make the package compatible with SQLAlchemy 1.4.*
Patch0: no_decl_class_registry.patch
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros