Skip to content

Commit 43148ac

Browse files
committed
Test without sqlalchemy-citext
The last sqlalchemy-citext update was in 2021 and it has various compatibility issues. SQLAlchemy now has CITEXT support.
1 parent 5caec1e commit 43148ac

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

doc/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Fixes:
88

99
* Jinja templates can now be loaded in StrictUndefined mode.
1010
* Remove an implicit dependency on `packaging`
11+
* Remove `sqlalchemy-citext1 from the optional dependencies. CITEXT supported by SQLAlchemy since 2.0.19.
1112

1213
2.0.0a2
1314
-------

flask_admin/tests/sqla/test_postgres.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
from citext import CIText
1+
try:
2+
from citext import CIText as CITEXT
3+
except ImportError:
4+
# SQLAlchemy >= 2.0.7, although there is an issue until 2.0.19
5+
from sqlalchemy.dialects.postgresql import CITEXT # type: ignore[attr-defined]
26
from sqlalchemy import text
37
from sqlalchemy.dialects.postgresql import HSTORE
48
from sqlalchemy.dialects.postgresql import JSON
@@ -94,7 +98,7 @@ class CITextModel(postgres_db.Model):
9498
id = postgres_db.Column(
9599
postgres_db.Integer, primary_key=True, autoincrement=True
96100
)
97-
citext_test = postgres_db.Column(CIText)
101+
citext_test = postgres_db.Column(CITEXT)
98102

99103
with postgres_db.engine.begin() as connection:
100104
connection.execute(text("CREATE EXTENSION IF NOT EXISTS citext"))

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ sqlalchemy = [
3636
sqlalchemy-with-utils = [
3737
"Flask-Admin[sqlalchemy]",
3838
"sqlalchemy_utils>=0.38.0",
39-
"sqlalchemy-citext>=1.8.0",
4039
"colour>=0.1.5",
4140
"email_validator>=2",
4241
"arrow>=0.13.0",

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ setenv =
2222
AZURE_STORAGE_CONNECTION_STRING = DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;
2323
deps =
2424
sqlalchemy1: sqlalchemy<2
25+
sqlalchemy1: sqlalchemy-citext
2526
-r requirements/tests.txt
2627
commands_pre =
2728
noflaskbabel: pip uninstall -y flask-babel

0 commit comments

Comments
 (0)