From 1fcb25be831a1d1c5ea9937993ed058a5313e1f6 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Fri, 21 Jun 2024 16:18:41 +0200 Subject: [PATCH] frontend: drop the sqlalchemy-utils dependency SQLAlchemy has a native support for DB identifier quotation, and the sqlalchemy-utils rebuilds are often sluggish after major SQLAlchemy updates, e.g. now on F40: $ sudo dnf install python3-sqlalchemy-utils Updating and loading repositories: Repositories loaded. Failed to resolve the transaction: Problem: package python3-sqlalchemy-utils-0.41.1-5.fc40.noarch from fedora requires (python3.12dist(sqlalchemy) < 2~~ with python3.12dist(sqlalchemy) >= 1.3), but none of the providers can be installed - package python3-sqlalchemy1.3-1.3.24-11.fc40.x86_64 from fedora conflicts with python3-sqlalchemy provided by python3-sqlalchemy-2.0.29-1.fc40.x86_64 from fedora - package python3-sqlalchemy1.4-1.4.52-1.fc40.x86_64 from fedora conflicts with python3-sqlalchemy >= 2 provided by python3-sqlalchemy-2.0.29-1.fc40.x86_64 from fedora - problem with installed package - package python3-sqlalchemy1.3-1.3.24-11.fc40.x86_64 from fedora conflicts with python3-sqlalchemy provided by python3-sqlalchemy-2.0.30-1.fc40.x86_64 from updates - package python3-sqlalchemy1.4-1.4.52-1.fc40.x86_64 from fedora conflicts with python3-sqlalchemy >= 2 provided by python3-sqlalchemy-2.0.30-1.fc40.x86_64 from updates - conflicting requests - installed package python3-sqlalchemy-2.0.30-1.fc40.x86_64 conflicts with python3-sqlalchemy provided by python3-sqlalchemy1.3-1.3.24-11.fc40.x86_64 from fedora - installed package python3-sqlalchemy-2.0.30-1.fc40.x86_64 conflicts with python3-sqlalchemy >= 2 provided by python3-sqlalchemy1.4-1.4.52-1.fc40.x86_64 from fedora You can try to add to command line: --allowerasing to allow erasing of installed packages to resolve problems --skip-broken to skip uninstallable packages --- frontend/copr-frontend.spec | 2 -- frontend/coprs_frontend/coprs/logic/batches_logic.py | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/frontend/copr-frontend.spec b/frontend/copr-frontend.spec index f06affe3e..113053027 100644 --- a/frontend/copr-frontend.spec +++ b/frontend/copr-frontend.spec @@ -108,7 +108,6 @@ BuildRequires: python3dist(redis) BuildRequires: python3dist(requests) BuildRequires: python3dist(sphinx) BuildRequires: python3dist(sphinxcontrib-httpdomain) -BuildRequires: python3dist(sqlalchemy-utils) BuildRequires: python3dist(whoosh) BuildRequires: python3dist(wtforms) >= 2.2.1 BuildRequires: python3dist(python-ldap) @@ -165,7 +164,6 @@ Requires: python3dist(pylibravatar) Requires: python3dist(pytz) Requires: python3dist(redis) Requires: python3dist(requests) -Requires: python3dist(sqlalchemy-utils) Requires: python3dist(templated-dictionary) Requires: python3dist(wtforms) >= 2.2.1 Requires: python3dist(pyzmq) diff --git a/frontend/coprs_frontend/coprs/logic/batches_logic.py b/frontend/coprs_frontend/coprs/logic/batches_logic.py index a23ae2fde..b9a09757b 100644 --- a/frontend/coprs_frontend/coprs/logic/batches_logic.py +++ b/frontend/coprs_frontend/coprs/logic/batches_logic.py @@ -8,7 +8,6 @@ from sqlalchemy.exc import SQLAlchemyError from sqlalchemy.sql import text -from sqlalchemy_utils.functions import quote as sa_quote from coprs import app, db, cache from coprs.helpers import WorkList from coprs.models import Batch, Build @@ -31,7 +30,7 @@ def _lock_table(table): # (commit / rollback) with db.engine.connect() as connection: connection.execute(text("LOCK TABLE {} IN EXCLUSIVE MODE;".format( - sa_quote(db.engine, table) + db.engine.identifier_preparer.quote(table) )))