File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ To be released.
2626 :meth: `~sqlalchemy_imageattach.entity.BaseImageSet.from_blob() ` can take
2727 ``extra_args ``/``extra_kwargs `` to be passed to entity model's constructor.
2828 [:issue: `32 `, :issue: `33 ` by Vahid]
29+ - Added :const: `sqlalchemy_imageattach.version.SQLA_COMPAT_VERSION ` and
30+ :const: `sqlalchemy_imageattach.version.SQLA_COMPAT_VERSION_INFO ` constants.
2931
3032
3133Version 0.9.0
Original file line number Diff line number Diff line change 44"""
55from __future__ import print_function
66
7+ __all__ = ('SQLA_COMPAT_VERSION' , 'SQLA_COMPAT_VERSION_INFO' ,
8+ 'VERSION' , 'VERSION_INFO' )
9+
10+
711#: (:class:`tuple`) The triple of version numbers e.g. ``(1, 2, 3)``.
8- VERSION_INFO = (0 , 9 , 0 )
12+ VERSION_INFO = (1 , 0 , 0 )
913
1014#: (:class:`str`) The version string e.g. ``'1.2.3'``.
1115VERSION = '{0}.{1}.{2}' .format (* VERSION_INFO )
1216
17+ #: (:class:`tuple`) The triple of minimum compatible SQLAlchemy version
18+ #: e.g. ``(0, 8, 0)``.
19+ #:
20+ #: .. versionadded:: 1.0.0
21+ SQLA_COMPAT_VERSION_INFO = (0 , 8 , 0 )
22+
23+ #: (:class:`str`) The minimum compatible SQLAlchemy version string
24+ #: e.g. ``'0.8.0'``.
25+ #:
26+ #: .. versionadded:: 1.0.0
27+ SQLA_COMPAT_VERSION = '{0}.{1}.{2}' .format (* SQLA_COMPAT_VERSION_INFO )
28+
1329
1430if __name__ == '__main__' :
1531 print (VERSION )
Original file line number Diff line number Diff line change 33import os
44
55from sqlalchemy import __version__
6- from sqlalchemy_imageattach .version import VERSION , VERSION_INFO
6+ from sqlalchemy_imageattach .version import (SQLA_COMPAT_VERSION ,
7+ SQLA_COMPAT_VERSION_INFO ,
8+ VERSION , VERSION_INFO )
79
810
911def test_version_info ():
@@ -15,9 +17,14 @@ def test_version_info():
1517
1618
1719def test_sqlalchemy_version ():
18- sqla_version_info = list (map (int , __version__ .split ('.' )[:2 ]))
19- assert sqla_version_info >= list (VERSION_INFO [:2 ])
20- assert __version__ .split ('.' )[:2 ] >= VERSION .split ('.' )[:2 ]
20+ def parse_int (s ):
21+ try :
22+ return int (s )
23+ except ValueError :
24+ return - 1
25+ sqla_version_info = tuple (map (parse_int , __version__ .split ('.' )[:3 ]))
26+ assert sqla_version_info >= SQLA_COMPAT_VERSION_INFO
27+ assert __version__ .split ('.' )[:3 ] >= SQLA_COMPAT_VERSION .split ('.' )[:2 ]
2128
2229
2330def test_version ():
You can’t perform that action at this time.
0 commit comments