utils: Introduce abstraction over distutils comparison of versions

In future, if the semantics need to better align with Debian's version
comparison, we can implement that easily.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2019-03-01 15:18:16 -08:00 committed by James Valleroy
parent 3d57feac24
commit ebca76b236
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -24,10 +24,13 @@ import os
import random import random
import re import re
import string import string
from distutils.version import LooseVersion
import ruamel.yaml import ruamel.yaml
from django.utils.functional import lazy from django.utils.functional import lazy
Version = LooseVersion # Abstraction over distutils.version.LooseVersion
def import_from_gi(library, version): def import_from_gi(library, version):
"""Import and return a GObject introspection library.""" """Import and return a GObject introspection library."""