diff --git a/logbook-pr316-sqlalchemy-count.patch b/logbook-pr316-sqlalchemy-count.patch new file mode 100644 index 0000000..40aafd5 --- /dev/null +++ b/logbook-pr316-sqlalchemy-count.patch @@ -0,0 +1,25 @@ +From d7ab99aaf12169dfa8092502a155273cfe483738 Mon Sep 17 00:00:00 2001 +From: Ben Greiner +Date: Fri, 7 May 2021 20:16:45 +0200 +Subject: [PATCH] replace removed SQLAlchemy Table.count() method + +--- + logbook/ticketing.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/logbook/ticketing.py b/logbook/ticketing.py +index 7321fa3..4f94ab8 100644 +--- a/logbook/ticketing.py ++++ b/logbook/ticketing.py +@@ -243,7 +243,10 @@ def record_ticket(self, record, data, hash, app_id): + + def count_tickets(self): + """Returns the number of tickets.""" +- return self.engine.execute(self.tickets.count()).fetchone()[0] ++ from sqlalchemy import select, func ++ ++ count_stmt = select([func.count()]).select_from(self.tickets) ++ return self.engine.execute(count_stmt).fetchone()[0] + + def get_tickets(self, order_by='-last_occurrence_time', limit=50, + offset=0): diff --git a/python-Logbook.changes b/python-Logbook.changes index fd8eb9d..cf84273 100644 --- a/python-Logbook.changes +++ b/python-Logbook.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri May 7 18:20:13 UTC 2021 - Ben Greiner + +- Add logbook-pr316-sqlalchemy-count.patch for compatibility with + SQLAlchemy 1.4 -- gh#getlogbook/logbook#316 + ------------------------------------------------------------------- Sat Mar 14 08:12:35 UTC 2020 - Tomáš Chvátal diff --git a/python-Logbook.spec b/python-Logbook.spec index 9497d86..d8c5cb6 100644 --- a/python-Logbook.spec +++ b/python-Logbook.spec @@ -1,7 +1,7 @@ # # spec file for package python-Logbook # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -25,6 +25,8 @@ Summary: A logging replacement for Python License: BSD-3-Clause URL: https://github.com/getlogbook/logbook Source: https://files.pythonhosted.org/packages/source/L/Logbook/Logbook-%{version}.tar.gz +# PATCH-FIX-UPSTREAM logbook-pr316-sqlalchemy-count.patch -- gh#getlogbook/logbook#316 +Patch1: https://github.com/getlogbook/logbook/pull/316.patch#/logbook-pr316-sqlalchemy-count.patch BuildRequires: %{python_module Brotli} BuildRequires: %{python_module Cython} BuildRequires: %{python_module Jinja2} @@ -58,7 +60,7 @@ BuildRequires: python-mock An alternative logging implementation for python. %prep -%setup -q -n Logbook-%{version} +%autosetup -p1 -n Logbook-%{version} dos2unix LICENSE %build