Because of some custom logging I would like to get the version number from a wheel file.
I could of course just parse the filename, but my guess is there would be a better way to do this.
Because of some custom logging I would like to get the version number from a wheel file.
I could of course just parse the filename, but my guess is there would be a better way to do this.
What I did for now is:
Get the package info and put it into a dict:
def get_package_info():
info_dict = {}
with open(os.path.join(glob.glob("./*.egg-info")[0], "PKG-INFO"), "r") as info:
for i in info:
i = i.split(":")
info_dict[i[0].strip()] = i[1].strip()
return info_dict
Now I can get the Verion from this dictionary.
If someone does have a better approach at this, please let me know.