File tree Expand file tree Collapse file tree 3 files changed +30
-4
lines changed Expand file tree Collapse file tree 3 files changed +30
-4
lines changed Original file line number Diff line number Diff line change 1+ Version 3.1.1
2+ -------------
3+
4+ Unreleased
5+
6+ - Deprecate the ``__version__ `` attribute. Use feature detection, or
7+ ``importlib.metadata.version("flask-sqlalchemy") ``, instead. :issue: `5230 `
8+
9+
110Version 3.1.0
211-------------
312
4- Released 2023-09-10
13+ Released 2023-09-11
514
615- Drop support for Python 3.7. :pr: `1251 `
716- Add support for the SQLAlchemy 2.x API via ``model_class `` parameter. :issue: `1140 `
Original file line number Diff line number Diff line change 11[project ]
22name = " Flask-SQLAlchemy"
3+ version = " 3.1.1.dev"
34description = " Add SQLAlchemy support to your Flask application."
45readme = " README.rst"
56license = { file = " LICENSE.rst" }
@@ -18,7 +19,6 @@ dependencies = [
1819 " flask>=2.2.5" ,
1920 " sqlalchemy>=2.0.16" ,
2021]
21- dynamic = [" version" ]
2222
2323[project .urls ]
2424Donate = " https://palletsprojects.com/donate"
Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3- from . extension import SQLAlchemy
3+ import typing as t
44
5- __version__ = "3.1.0"
5+ from . extension import SQLAlchemy
66
77__all__ = [
88 "SQLAlchemy" ,
99]
10+
11+
12+ def __getattr__ (name : str ) -> t .Any :
13+ if name == "__version__" :
14+ import importlib .metadata
15+ import warnings
16+
17+ warnings .warn (
18+ "The '__version__' attribute is deprecated and will be removed in"
19+ " Flask-SQLAlchemy 3.2. Use feature detection or"
20+ " 'importlib.metadata.version(\" flask-sqlalchemy\" )' instead." ,
21+ DeprecationWarning ,
22+ stacklevel = 2 ,
23+ )
24+ return importlib .metadata .version ("flask-sqlalchemy" )
25+
26+ raise AttributeError (name )
You can’t perform that action at this time.
0 commit comments