[Python-Dev] Edits to Metadata 1.2 to add extras (optional dependencies)

Daniel Holth dholth at gmail.com
Tue Aug 28 17:30:43 CEST 2012


On Tue, Aug 28, 2012 at 10:47 AM, "Martin v. Löwis" <martin at v.loewis.de> wrote:
>>> Prepare for a ten-year period of acceptance - so it
>>> would be good to be sure that no further additions are desired within
>>> the next ten years before seeking approval for the PEP.
>>
>>
>> However, this point I really don't agree with. The packaging ecosystem
>> is currently evolving outside the standard library, but the
>> standardisation process for the data interchange formats still falls
>> under the authority of python-dev and the PEP process.
>
>
> Maybe I misphrased. By "accepted" I meant "widely implemented". From
> the day this gets published until it is really usable, I still believe
> 10 years is realistic. For example, setuptools doesn't implement Meta-data
> 1.2, and nearly nobody uses it, 8 years after it was written.
>
>> When the packaging module is finally added (hopefully 3.4, even if
>> that means we have to temporarily cull the entire compiler
>> subpackage), it will handle the most recent accepted version of the
>> metadata format (as well as any previous versions). If more holes
>> reveal themselves in the next 18 months, then it's OK if v1.4 is
>> created when it becomes clear that it's necessary.
>
>
> The problem is that flooding people with specifications is a guarantee
> that they will not get implemented. So we can have one metadata
> specification every ten years; if we have more, none of them will be
> implemented (except in the tool of the author of the PEP).

Why not. You get the feature in the tool, and you don't get it
elsewhere, but the other implementation can still parse what it
understands. The tool author promotes his tool for this reason. The
extension format is intentionally ugly so that people will standardize
eventually if only for aesthetic reasons. Yes, you have to support
popular extensions forever, it's a messy world we live in.

Two tools that implement Metadata 1.2+ are called wheel and distribute
>= 0.6.28. It's just adding the requirements in PKG-INFO (METADATA)
instead of in a separate .txt file. Unfortunately it was necessary to
add Setup-Requires-Dist:, Provides-Extra: and an extra variable in the
conditional-dependencies (environment markers) spec to be able to
represent setuptools data present in 10% of the packages on PyPi. So
it is necessary to edit the PEP for the environment markers, but
Provides-Extra could change to

Extension: distribute
Distribute-Provides-Extra: foo

(Just require un-hyphenated names in Extension: or map them to
underscore _ if you must)

-1 on doing anything but mapping them to package names.

I can't provide a regex to strictly validate Requires-Dist: foo ;
condition because condition is an impoverished subset of the Python
language filtered with the wonderful ast module.

Are you really willing to unpack and validate PKG-INFO on every
archive that is uploaded to pypi?


More information about the Python-Dev mailing list