[Distutils] Adding Provides-Extra as an edit to PEP 345

Daniel Holth dholth at gmail.com
Tue Jul 10 01:38:42 CEST 2012


>>> Under a scheme like this one would have to list that dependency under
>>> Requires-Dist twice: with and without the 'extra' marker.  I might
>>> still prefer extending the metadata format to add a
>>> Setup-Requires-Dist or the like.

> The difference is that setup/build dependencies generally should be
> downloaded, extracted, and added to the path before another commands
> are run, because the packaging framework allows for the behavior of
> built-in commands themselves to be modified, as well as certain
> metadata.  The usefulness of this has been discussed in past threads.

Setup requirements are certainly necessary.

I see what you mean now. 'Setup-Requires-Dist' is a different feature
than 'Provides-Extra', since with 'Provides-Extra' there isn't an
elegant way to figure out what "just the setup requirements are".
Provides-Extra is only useful if you want to install the mandatory
runtime requirements at the same time (which is exactly what you want
to do for 'extras').

You could make the argument that you only need setup_requires_dist in
setup.cfg... since it will generate METADATA the first time (when
downloading from revision control) anyway. But it can also go in
METADATA, you will get no complaint from me.

Of course I did download PyPI, that's the way to tell. Just under 80%
of the newest sdists for each package on PyPI contain PKG-INFO.

How many phases does a build + install have? Is this about right?

1. Install setup requirements "Setup-Requires-Dist" from .dist-info/METADATA
2. Run setup "dist_info" (pip always runs egg_info) to get a
.dist-info directory with METADATA inside
3. Read up-to-date runtime requirements "Requires-Dist"
4. Install those
5. Install package setup "install"


More information about the Distutils-SIG mailing list