The question is an attempt to get the exact instruction on how to do that. There were few attempts before, which don't seem to be full solutions:
solution to move the file inside the package
accessing meta info via get_distribution
The task at hand is to read the information about the egg the program is running from. There are few ways as i understand:
hard code the location of the egg and treat it as zip archive - will work, but not flexible enough, because it will need to be edited and recompiled in case if file is moved to another location
use
ResourceManager().resource_filename(__name__, filename)
- this seems to be limited in the fact that i cannot access the file that is inside the egg, but not inside the package. notations like "../../EGG-INFO/PKG-INFO" in filename don't work giving KeyError. So no good either.use
dist = pkg_resources.get_distribution("dist_name")
and then use dist object to get information, but I cannot understand from the docs how should i specify my distribution name? It can't find it.
So, i'm looking for correct solution about using pkg_resources.get_distribution
plus it would be nice to finally have a full solution to read any file from inside the egg.
Thanks!