Skip to content

Commit

Permalink
Test without sqlalchemy-citext
Browse files Browse the repository at this point in the history
The last sqlalchemy-citext update was in 2021 and it has various
compatibility issues.

SQLAlchemy now has CITEXT support.
  • Loading branch information
cjmayo committed Sep 4, 2024
1 parent 5b069be commit 3468d1e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
8 changes: 6 additions & 2 deletions flask_admin/tests/sqla/test_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

from sqlalchemy import text
from sqlalchemy.dialects.postgresql import HSTORE, JSON
from citext import CIText
try:
from citext import CIText as CITEXT
except ImportError:
# SQLAlchemy >= 2.0.7, although there is an issue until 2.0.19
from sqlalchemy.dialects.postgresql import CITEXT


def test_hstore(app, postgres_db, postgres_admin):
Expand Down Expand Up @@ -79,7 +83,7 @@ def test_citext(app, postgres_db, postgres_admin):
with app.app_context():
class CITextModel(postgres_db.Model):
id = postgres_db.Column(postgres_db.Integer, primary_key=True, autoincrement=True)
citext_test = postgres_db.Column(CIText)
citext_test = postgres_db.Column(CITEXT)

with postgres_db.engine.begin() as connection:
connection.execute(text('CREATE EXTENSION IF NOT EXISTS citext'))
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ sqlalchemy = [
sqlalchemy-with-utils = [
"Flask-Admin[sqlalchemy]",
"sqlalchemy_utils>=0.38.0",
"sqlalchemy-citext>=1.8.0",
"colour>=0.1.5",
"email_validator>=2",
"arrow>=0.13.0",
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ setenv =
SQLALCHEMY_SILENCE_UBER_WARNING = 1
AZURE_STORAGE_CONNECTION_STRING = DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;
deps =
sqlalchemy1: -c requirements-skip/constraints-sqlalchemy1.txt
sqlalchemy1: sqlalchemy-citext -c requirements-skip/constraints-sqlalchemy1.txt
-r requirements/tests.txt
commands_pre =
noflaskbabel: pip uninstall -y flask-babel
Expand Down

0 comments on commit 3468d1e

Please sign in to comment.