- Add sqlalchemy-2.0.22.patch to make it compatible with
SQLAlchemy>=2.0.22, gh#kvesteri/sqlalchemy-utils#725 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-SQLAlchemy-Utils?expand=0&rev=77
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Jan 18 11:05:27 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>
|
||||
|
||||
- Add sqlalchemy-2.0.22.patch to make it compatible with
|
||||
SQLAlchemy>=2.0.22, gh#kvesteri/sqlalchemy-utils#725
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jun 13 05:17:03 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-SQLAlchemy-Utils
|
||||
#
|
||||
# Copyright (c) 2023 SUSE LLC
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -23,6 +23,8 @@ Summary: Various utility functions for SQLAlchemy
|
||||
License: BSD-3-Clause
|
||||
URL: https://github.com/kvesteri/sqlalchemy-utils
|
||||
Source: https://files.pythonhosted.org/packages/source/S/SQLAlchemy-Utils/SQLAlchemy-Utils-%{version}.tar.gz
|
||||
# PATCH-FIX-OPENSUSE sqlalchemy-2.0.22.patch gh#kvesteri/sqlalchemy-utils#725
|
||||
Patch1: sqlalchemy-2.0.22.patch
|
||||
BuildRequires: %{python_module Babel >= 1.3}
|
||||
BuildRequires: %{python_module Jinja2 >= 2.3}
|
||||
BuildRequires: %{python_module Pygments >= 1.2}
|
||||
@@ -38,6 +40,7 @@ BuildRequires: %{python_module intervals >= 0.7.1}
|
||||
BuildRequires: %{python_module passlib >= 1.6}
|
||||
BuildRequires: %{python_module pendulum >= 2.0.5}
|
||||
BuildRequires: %{python_module phonenumbers >= 5.9.2}
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module psycopg2 >= 2.5.1}
|
||||
BuildRequires: %{python_module psycopg2cffi >= 2.8.1}
|
||||
BuildRequires: %{python_module pyodbc}
|
||||
@@ -45,6 +48,7 @@ BuildRequires: %{python_module pytest >= 2.7.1}
|
||||
BuildRequires: %{python_module python-dateutil >= 2.6}
|
||||
BuildRequires: %{python_module pytz >= 2014.2}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires: python-SQLAlchemy >= 1.0
|
||||
@@ -68,13 +72,13 @@ Requires: python-backports.zoneinfo
|
||||
Various utility functions and custom data types for SQLAlchemy.
|
||||
|
||||
%prep
|
||||
%setup -q -n SQLAlchemy-Utils-%{version}
|
||||
%autosetup -p1 -n SQLAlchemy-Utils-%{version}
|
||||
|
||||
%build
|
||||
%python_build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%python_install
|
||||
%pyproject_install
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
%check
|
||||
@@ -104,6 +108,6 @@ rm tests/types/test_uuid.py
|
||||
%doc README.rst
|
||||
%dir %{python_sitelib}/sqlalchemy_utils
|
||||
%{python_sitelib}/sqlalchemy_utils/*
|
||||
%{python_sitelib}/SQLAlchemy_Utils-%{version}-py*.egg-info
|
||||
%{python_sitelib}/SQLAlchemy_Utils-%{version}*-info
|
||||
|
||||
%changelog
|
||||
|
||||
28
sqlalchemy-2.0.22.patch
Normal file
28
sqlalchemy-2.0.22.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
From 712aabaefc5c8ca3680751c705cf5a5984c74af1 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Garcia Moreno <daniel.garcia@suse.com>
|
||||
Date: Thu, 18 Jan 2024 11:02:54 +0100
|
||||
Subject: [PATCH] Update GenericAttributeImpl to work with SqlAlchemy 2.0.22
|
||||
|
||||
Fix https://github.com/kvesteri/sqlalchemy-utils/issues/719
|
||||
---
|
||||
sqlalchemy_utils/generic.py | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
Index: SQLAlchemy-Utils-0.41.1/sqlalchemy_utils/generic.py
|
||||
===================================================================
|
||||
--- SQLAlchemy-Utils-0.41.1.orig/sqlalchemy_utils/generic.py
|
||||
+++ SQLAlchemy-Utils-0.41.1/sqlalchemy_utils/generic.py
|
||||
@@ -13,6 +13,13 @@ from .functions.orm import _get_class_re
|
||||
|
||||
|
||||
class GenericAttributeImpl(attributes.ScalarAttributeImpl):
|
||||
+ def __init__(self, *args, **kwargs):
|
||||
+ # arguments received (class, key, dispatch)
|
||||
+ # The attributes.AttributeImpl requires (class, key, default_function, dispatch)
|
||||
+ # Setting None as default_function here
|
||||
+ args = args[:2] + (None, ) + args[2:]
|
||||
+ super().__init__(*args, **kwargs)
|
||||
+
|
||||
def get(self, state, dict_, passive=attributes.PASSIVE_OFF):
|
||||
if self.key in dict_:
|
||||
return dict_[self.key]
|
||||
Reference in New Issue
Block a user