Python django.utils.version.get_version_tuple() Examples

The following are 7 code examples of django.utils.version.get_version_tuple(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module django.utils.version , or try the search function .
Example #1
Source File: utils.py    From django-cockroachdb with Apache License 2.0 6 votes vote down vote up
def check_django_compatability():
    """
    Verify that this version of django-cockroachdb is compatible with the
    installed version of Django. For example, any django-cockroachdb 2.2.x is
    compatible with Django 2.2.y.
    """
    from . import __version__
    if django.VERSION[:2] != get_version_tuple(__version__)[:2]:
        raise ImproperlyConfigured(
            'You must use the latest version of django-cockroachdb {A}.{B}.x '
            'with Django {A}.{B}.y (found django-cockroachdb {C}).'.format(
                A=django.VERSION[0],
                B=django.VERSION[1],
                C=__version__,
            )
        ) 
Example #2
Source File: base.py    From bioforum with MIT License 5 votes vote down vote up
def psycopg2_version():
    version = psycopg2.__version__.split(' ', 1)[0]
    return get_version_tuple(version) 
Example #3
Source File: libgeos.py    From bioforum with MIT License 5 votes vote down vote up
def geos_version_tuple():
    """Return the GEOS version as a tuple (major, minor, subminor)."""
    return get_version_tuple(geos_version().decode()) 
Example #4
Source File: base.py    From Hands-On-Application-Development-with-PyCharm with MIT License 5 votes vote down vote up
def psycopg2_version():
    version = psycopg2.__version__.split(' ', 1)[0]
    return get_version_tuple(version) 
Example #5
Source File: base.py    From opentaps_seas with GNU Lesser General Public License v3.0 5 votes vote down vote up
def psycopg2_version():
    version = psycopg2.__version__.split(' ', 1)[0]
    return get_version_tuple(version) 
Example #6
Source File: tests.py    From djongo with GNU Affero General Public License v3.0 5 votes vote down vote up
def test_get_version_tuple(self):
        self.assertEqual(get_version_tuple('1.2.3'), (1, 2, 3))
        self.assertEqual(get_version_tuple('1.2.3b2'), (1, 2, 3))
        self.assertEqual(get_version_tuple('1.2.3b2.dev0'), (1, 2, 3)) 
Example #7
Source File: tests.py    From djongo with GNU Affero General Public License v3.0 5 votes vote down vote up
def test_get_version_tuple(self):
        self.assertEqual(get_version_tuple('1.2.3'), (1, 2, 3))
        self.assertEqual(get_version_tuple('1.2.3b2'), (1, 2, 3))
        self.assertEqual(get_version_tuple('1.2.3b2.dev0'), (1, 2, 3))