Repository navigation
Conversation
|
Thanks @cjmayo for the test job 🤓 I ran # flask_admin/contrib/sqla/_types.py
except ImportError:
T_SQLALCHEMY: t.Any | None = None # type: ignore[no-redef]
T_SESSION: t.Any | None = None # type: ignore[no-redef]Once that is in, the job hits one more thing in
sqla_db_exts: list[type[T_ANY_SQLA_PROVIDER]] = []
if HAS_FLASK_SQLALCHEMY:
sqla_db_exts.append(SQLAProvider)With both, collection works and the tests that don't need services pass locally (220 passed; Postgres/Azure need the CI services). The branch is also behind master, so it needs a rebase. We can then close #2964 as superseded. WDYT? |
|
T_SESSION should import from flask_sqlalchemy_lite though, not be None |
except ImportError:
T_SQLALCHEMY: t.Any | None = None # type: ignore[no-redef]
from sqlalchemy.orm import Session as T_SESSION # type: ignore[assignment]I tried it: with lite only, |
f151e60 to
af4d42a
Compare
>>> from flask_admin.contrib.sqla import ModelView
Traceback (most recent call last):
File "<python-input-0>", line 1, in <module>
from flask_admin.contrib.sqla import ModelView
File "/usr/lib/python3.14/site-packages/flask_admin/contrib/sqla/__init__.py", line 2, in <module>
from .view import ModelView
File "/usr/lib/python3.14/site-packages/flask_admin/contrib/sqla/view.py", line 33, in <module>
from flask_admin.contrib.sqla import form
File "/usr/lib/python3.14/site-packages/flask_admin/contrib/sqla/form.py", line 47, in <module>
from ._compat import _get_deprecated_session
File "/usr/lib/python3.14/site-packages/flask_admin/contrib/sqla/_compat.py", line 7, in <module>
from flask_admin.contrib.sqla._types import T_SESSION
ImportError: cannot import name 'T_SESSION' from 'flask_admin.contrib.sqla._types' (/usr/lib/python3.14/site-packages/flask_admin/contrib/sqla/_types.py)
Reported-by: me
Co-authored-by: Prakapovich Pavel <flyguy.by@gmail.com>
Co-authored-by: Hasan Sezer Taşan <13135006+hasansezertasan@users.noreply.github.com>
Co-authored-by: Lorenzo <lorenzo.cerreta@gmail.com>
Co-authored-by: Hasan Sezer Taşan <13135006+hasansezertasan@users.noreply.github.com>
af4d42a to
58c1b9e
Compare
|
I've rebased, added the fix and updated to be Seems there is more to do: |
|
I can take it from here, if you want. |
Yes please! |
flask-sqlalchemy-lite without flask-sqlalchemy is not being tested, causing a bug to be missed: #2958
HAS_FLASK_SQLALCHEMYwas a way to get this test working. Maybe that needs some more thought.