Adjusted pkginfo

This commit is contained in:
krateng 2021-12-25 22:02:28 +01:00
parent 61b1271491
commit cdd762a07a
1 changed files with 12 additions and 4 deletions

View File

@ -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"
}