<div dir="ltr">Hi, Phillip,<br>That works nice. Is there a way to derive &#39;MyPackageName&#39; from the available metadata on the fly instead of hard-coding the package name within some python code inside the package itself? I ask because I want to keep things DRY (Don&#39;t Repeat Yourself).<br>
<br><div class="gmail_quote">On Thu, Sep 18, 2008 at 6:49 AM, Phillip J. Eby <span dir="ltr">&lt;<a href="mailto:pje@telecommunity.com">pje@telecommunity.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">At 01:08 AM 9/18/2008 -0700, Pavel Repin wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Is there a recommended way to obtain version information of an executing application?<br>
For instance, if my application script wants to write a log message containing its own version, I&#39;d like to get the version info stored in its PKG-INFO file.<br>
Hopefully, this runtime version info access method should work both in developer mode for apps installed with &quot;setup.py develop&quot; command, and when running them as eggs installed with easy_install script.<br>
<br>
Any ideas?<br>
</blockquote>
<br></div></div>
Something like pkg_resources.require(&#39;MyProjectName&#39;)[0].version should work.<br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>Pavel Repin<br>
</div>