1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Adjusted pkginfo

This commit is contained in:
krateng 2021-12-25 22:02:28 +01:00
parent 61b1271491
commit cdd762a07a

View File

@ -1,11 +1,19 @@
# This file has now been slighly repurposed and will simply give other parts of # This file has now been slighly repurposed and will simply give other parts of
# the package access to some global meta-information about itself # the package access to some global meta-information about itself
import pkg_resources try:
self = pkg_resources.get_distribution('maloja') # 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 versionstr = metadata['version']
version = self.version.split('.') version = versionstr.split('.')
urls = { urls = {
"repo":"https://github.com/krateng/maloja" "repo":"https://github.com/krateng/maloja"
} }