# HG changeset patch # User Nsukami Patrick # Date 1575369296 -3600 # Node ID 894d0fd94f73c2b3a8c1ecc9ed1b147e62967f7f # Parent 842939e69f3a774fa50819de6a02f6a9f51a5def [pkginfo] Retrieve Cubicweb version using pkg_resources diff -r 842939e69f3a -r 894d0fd94f73 cubicweb/cwconfig.py --- a/cubicweb/cwconfig.py Fri Nov 22 12:06:52 2019 +0000 +++ b/cubicweb/cwconfig.py Tue Dec 03 11:34:56 2019 +0100 @@ -409,11 +409,12 @@ def cubicweb_version(): """return installed cubicweb version""" from logilab.common.changelog import Version - from cubicweb import __pkginfo__ - version = __pkginfo__.numversion + str_base_version = pkg_resources.get_distribution('cubicweb').parsed_version.base_version + version = tuple([int(x) for x in str_base_version.split('.')]) assert len(version) == 3, version return Version(version) + @staticmethod def persistent_options_configuration(): return Configuration(options=PERSISTENT_OPTIONS)