title: Standard way to embed version into Python package?
body: <p>Is there a standard way to associate version string with a Python package in such way that I could do the following?</p>
  <pre class="lang-py prettyprint-override"><code>import foo
  print(foo.version)
  </code></pre>
  <p>I would imagine there's some way to retrieve that data without any extra hardcoding, since minor/major strings are specified in <code>setup.py</code> already. Alternative solution that I found was to have <code>import __version__</code> in my <code>foo/__init__.py</code> and then have <code>__version__.py</code> generated by <code>setup.py</code>.</p>