Skip to content

Commit 0c9948c

Browse files
committed
Metadata for compatible SQLAlchemy version
1 parent 8417216 commit 0c9948c

3 files changed

Lines changed: 25 additions & 5 deletions

File tree

docs/changes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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

3133
Version 0.9.0

sqlalchemy_imageattach/version.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,28 @@
44
"""
55
from __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'``.
1115
VERSION = '{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

1430
if __name__ == '__main__':
1531
print(VERSION)

tests/version_test.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
import os
44

55
from 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

911
def test_version_info():
@@ -15,9 +17,9 @@ def test_version_info():
1517

1618

1719
def 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+
sqla_version_info = tuple(map(int, __version__.split('.')[:3]))
21+
assert sqla_version_info >= SQLA_COMPAT_VERSION_INFO
22+
assert __version__.split('.')[:3] >= SQLA_COMPAT_VERSION.split('.')[:2]
2123

2224

2325
def test_version():

0 commit comments

Comments
 (0)