from pkg_resources import get_distribution, DistributionNotFound
try:
    __version__ = get_distribution('kbcstorage').version
except DistributionNotFound:
    # package is not installed
    pass

from pkg_resources import get_distribution, DistributionNotFound
try:
    release = get_distribution('kbcstorage').version
    __version__ = '.'.join(release.split('.')[:2])
except DistributionNotFound:
    # package is not installed
    pass

Make package version string major.minor only
Make package version string major.minor only
