[Distutils] Versioned entry points

Paul Moore p.f.moore at gmail.com
Fri Mar 28 15:56:30 CET 2014


One open question with pip's handling of script generation for wheels
is what to do with versioned entry points (virtualenv-2.7.exe etc).

At the moment, pip explicitly disables distlib's facility to generate
"versioned" script wrappers for entry points, and generates exactly
what the project metadata specifies[1]. The problem is that some
projects use sys.version in setup.py to explicitly specify versioned
commands. This does not work for wheels, where the build and install
environments are different.

There's an open issue for virtualenv, which has hit this problem, and
I suspect there are a number of other projects which will hit it if &
when they start publishing wheels (I think py.test and nose have the
same problem, for a start).

The first question is, who should be responsible for deciding whether
to have versioned commands anyway? Is that a project decision, or
should it be left to the user doing the install? Should the user be
allowed to override a project default?

If it's a user decision, pip probably needs an additional command line
argument to specify whether the user wants versioned commands. We may
also want pip to ignore any existing entry point specifications that
look like they are versioned. (And of course someone needs to tell the
projects that currently specify versioned entry points that they
should stop :-))

If it's a project decision, we need a means for the project to record
that data in metadata that pip can read. For Metadata 2.0, that means
something in the console script metadata extension [2]. For the short
term, we may need some sort of convention or addition for
entry_points.txt. But I'm not sure who would be affected by something
like that (beyond the obvious answer of setuptools and pip...)

Does anyone have any thoughts?

Paul

[1] There's a hack in there to generate versioned entry points for pip
and easy_install.
[2] What's the process for agreeing on extension schemas? Do they need
their own PEPs, or what? I was skimming the discussion at the point
when these things got pushed out to extensions, so I missed the
detail.


More information about the Distutils-SIG mailing list