diff --git a/maloja/__pkginfo__.py b/maloja/__pkginfo__.py index 61d2014..df9a902 100644 --- a/maloja/__pkginfo__.py +++ b/maloja/__pkginfo__.py @@ -1,11 +1,19 @@ # This file has now been slighly repurposed and will simply give other parts of # the package access to some global meta-information about itself -import pkg_resources -self = pkg_resources.get_distribution('maloja') +try: + # package distributrion + import pkg_resources + self = pkg_resources.get_distribution('maloja') + metadata = {'version':self.version} +except: + # from source + import toml + with open("./pyproject.toml") as filed: + metadata = toml.load(filed)['project'] -versionstr = self.version -version = self.version.split('.') +versionstr = metadata['version'] +version = versionstr.split('.') urls = { "repo":"https://github.com/krateng/maloja" }