title: How to use "setup.cfg" instead of setup.py with Python 2.7
body: <p>It seemed to me, that instead of the whole plethora of named keyword-arguments for
  the <code>distutils.core.setup</code> function, one can use a <code>setup.cfg</code> file in the same directory
  as the <code>setup.py</code> file and all these keywords will be read from the setup.cfg file.</p>
  
  <p>I thought i could simply create a <code>setup.cfg</code> with Python 2.7, but a minimal testing
  version just does not work. I did test it with <code>setup.py --name</code>, which
  just returns: <code>UNKNOWN</code>.</p>
  
  <p>And as usual with python-packaging the documentation is confusing as hell,
  as it is never clear, which version they relate to or at least how old the 
  documentation is. </p>
  
  <p>My two setup files:</p>
  
  <p>setup.py:</p>
  
  <pre><code>from distutils.core import setup
  setup()
  </code></pre>
  
  <p>setup.cfg:</p>
  
  <pre><code>[metadata]
  name = foo
  version = 0.1
  </code></pre>
  
  <p>I looked into the distutils package and found that (besides being fugly as hell)
  it seems to <a href="https://hg.python.org/cpython/file/301d62ef5c0b/Lib/distutils/dist.py#l1051">use the <code>mail.message_from_file</code></a> factory to read the <code>setup.cfg</code>. </p>
  
  <p>As i am quite ok with a <code>setup.py</code>-only approach i would not bother much longer
  with such nonsense, but i am still curious how to do it right, if it is possible at all.</p>
  
  <p>Neither the <a href="http://packaging.python.org">official packaging doc</a> nor the <a href="https://github.com/pypa">Packaging-Authority</a> seems to be a big help here.</p>
  
  <hr>
  
  <p><em>Almost every time i feel compelled to look into python's 2.x stdlib i am wondering if they
  try to showcase how not to program. On the other hand the C-Code seems quite beautiful.</em></p>