Hello

Following the discussion on the format of the static metadata file,
it's evident for me that it has to be a ConfigParser file.

Now for the name of the file, I wouldn't want yet another file since
we already have
setup.cfg and since it can be extended w/o any problem or bacward
compatibility issue.

(That's from Tres and Matthias idea at Pycon)

I am also realizing that we can use it to describe "static metadata"
almost with the
existing distutils code.

We can use the [global] section of the setup.cfg file to describe them.

If we want to remove all metadata expressed as setup() arguments, we
can just move them
to the setup.cfg.

example of setup.cfg file:

"""
[global]
name: foo
version: 1.0
author: tarek
long_description: some
  long description
  here

url: http://example.com
"""

What's left in setup.py :

"""
from distutils.core import setup

setup()
"""

Right now the behavior of the code is:

Distutils will take the setup.cfg options and apply them to the
Distribution class,
overriding any argument passed to setup(), then they will be in turn
overriden by
the command line options if any.

This behavior seems fine.

Now there's a very small change to make in distutils to make this work,
wich consists of applying these values to the DistutilsMetadata
object (the metadata attribute in the dist instance)

I've changed this in my working trunk to give a try, and it works fine.

the long_description field is expressed as a multi-line field following
the config parser convention so no problem for it (see my example)

Although there's another change we need to apply and decide : being
able to express a
list of values, for fields like "keywords" or "classifiers".

It can be a "," separated list of values, or a "\n" separated one.

I am proposing the current scheme (applying it in this precise order):

1/ if the value contains '\n' signs, it's a  list and values are
splitted using \n, then each element is left stripped
   (not sure yet if we want to right strip them too)

2/ if the value contains ',' signs, it's a list and values are
splitted using ','    (not sure yet if we want to strip them)
3/ else, it's a value

This allows us to use "," for small lists like keywords we know they
will never contain any "," sign,
and several lines when the values might contain "," signs. So for example:


"""
[global]
name: foo
version: 1.0
author: tarek
long_description: some
  long description
  here

url: http://example.com
keywords: one, two, three
classifiers =
  Classifier1
  Classifier2
  Classifier3
"""

Any thoughts ?


Cheers
Tarek

-- 
Tarek Ziadé | http://ziade.org
_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to