Skip to content

Commit

Permalink
frontend: drop the sqlalchemy-utils dependency
Browse files Browse the repository at this point in the history
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
  • Loading branch information
praiskup committed Jun 21, 2024
1 parent 571c31c commit dd97783
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions frontend/copr-frontend.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions frontend/coprs_frontend/coprs/logic/batches_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -31,7 +30,8 @@ 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)
# https://docs.sqlalchemy.org/en/13/core/internals.html#sqlalchemy.sql.compiler.IdentifierPreparer.quote
db.engine.identifier_preparer.quote(table)
)))


Expand Down

0 comments on commit dd97783

Please sign in to comment.