On Jun 09, 2011, at 01:29 PM, Éric Araujo wrote:

>Yes, the PEP uses that field since I said I thought it could not reuse
>the version field; my email was meant to change “I think it should be
>another field” to “it must definitely be another field”.
>
>version-from-file is a good name if a regex is applied to extract a
>version from the first lines of a file; if the whole contents of the
>file are the version number (sorry Ben, I cannot call it something else
>:), it should be version-file to mirror description-file.

Hi Éric, I hadn't thought about a file that only contains the version number,
but that makes perfect sense.  Here's what I propose for the PEP.

Distutils2
----------

Because the distutils2 style ``setup.cfg`` is declarative, we can't
run any code to extract the ``__version__`` attribute, either via
import or via parsing.

In consultation with the distutils-sig [9]_, two options are
proposed.  Both entail containing the version number in a file, and
declaring that file in the ``setup.cfg``.  When the entire contents of
the file contains the version number, the ``version-file`` key will be
used::

    [metadata]
    version-file: version.txt

When the version number is contained within a larger file, e.g. of
Python code, such that the file must be parsed to extract the version,
the key ``version-from-file`` will be used::

    [metadata]
    version-from-file: elle.py

A parsing method similar to that described above will be performed on
the file named after the colon.  The exact recipe for doing this will
be discussed in the appropriate distutils2 development forum.

Cheers,
-Barry

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to