flask-sqlalchemy-compat v0.2.0
Introduction
Support the compatibility between flask_sqlalchemy and flask_sqlalchemy_lite. It allows users to make minimal changes when they need to migrate from either one of these two packages to each other.
The main motivation of this package is because flask_sqlalchemy_lite does not support python<=3.8. This package is designed for providing the similar usages when users have to make the flask_sqlalchemy_lite working with python<=3.8 by using flask_sqlalchemy. In this case, users can get rid of the difficulty of maintaining two sets of codes.
Changelog
0.2.0 @ 12/13/2024
📣 New
- Make
backends.fsaandbackends.fsa_liteprotected bybackends.proxy. The other parts of this project will access backends module by this newly addedproxy. This change allows users to deliberately changeproxyfor testing purposes. For example, the users can disableflask-sqlalchemyby settingproxy.fsa = Noneeven if the package is already installed. - Provide two new methods
get_flask_sqlalchemy_proxy_ver(...)andget_flask_sqlalchemy_lite_proxy_ver(...). In run time, they are totally the same asget_flask_sqlalchemy(...)andget_flask_sqlalchemy_lite(...), respectively. The only difference is that the returned values of_proxy_ver(...)are notated by the the proxy classes likeSQLAlchemyProxy. Users can use these methods to check the compatibility with the falling back version via the static type checker. - Add three examples (demos):
examples.app_fsqla,examples.app_fsqla_lite,usage. - Add unit tests and the corresponding configurations.
- Add the GitHub workflow for running the unit tests.
🔧 Fix
- Fix: When the module is reloaded, accessing the
SQLAlchemyProxy().Model.querymay causeRuntimeError. Now, this error has been catched. - Fix: Prevent
flake8from raisingF722when working with older python versions (Python<3.10).
💾 Change
- Update the metadata of the package. The chages are made for adjusting the new optional dependencies and tests.
- Update the project information for preparing to upload a new PyPI release.
Full Changelog: v0.1.3...v0.2.0