It seemed to me, that instead of the whole plethora of named keyword-arguments for
the distutils.core.setup
function, one can use a setup.cfg
file in the same directory
as the setup.py
file and all these keywords will be read from the setup.cfg file.
I thought i could simply create a setup.cfg
with Python 2.7, but a minimal testing
version just does not work. I did test it with setup.py --name
, which
just returns: UNKNOWN
.
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.
My two setup files:
setup.py:
from distutils.core import setup
setup()
setup.cfg:
[metadata]
name = foo
version = 0.1
I looked into the distutils package and found that (besides being fugly as hell)
it seems to use the mail.message_from_file
factory to read the setup.cfg
.
As i am quite ok with a setup.py
-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.
Neither the official packaging doc nor the Packaging-Authority seems to be a big help here.
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.