Flask-SQLAlchemy-Lite support for flask-migrate
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.1k
- Forks
- 2.1k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 82
Description
Flask-SQLAlchemy-Lite was just released which is intended to be a replacement for Flask-SQLAlchemy.
https://flask-sqlalchemy-lite.readthedocs.io/en/stable/
With that there is then a type conflict with flask_migrate:
https://github.com/python/typeshed/blob/main/stubs/Flask-Migrate/flask_migrate/__init__.pyi#L52
It expects flask_sqlalchemy.extension.SQLAlchemy, but flask_sqlalchemy_lite._extension.SQLAlchemy is now a compatible alternative
I'm pretty new to python so I'm not sure what the best approach to allow the flask_migrate typings to allow both.
Would it work to:
# ...
from flask_sqlalchemy import SQLAlchemy
from flask_sqlalchemy_lite import SQLAlchemy as SQLAlchemyLite
# ...
class Migrate:
configure_callbacks: list[_ConfigureCallback]
db: SQLAlchemy | SQLAlchemyLite | None
# ...
Or is there a better approach?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Flask-Migrate stub at stubs/Flask-Migrate/flask_migrate/init.pyi, especially the SQLAlchemy type around line 52, and review the linked Flask-SQLAlchemy-Lite documentation. Determine a typing approach that accepts both SQLAlchemy implementations without introducing an import or compatibility conflict; done means the stub accurately supports either integration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- flask, python, sqlalchemy
- Domain
- backend, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100