[Python-Dev] decoding setuptools entry point scripts (was: Bilingual scripts)
R. David Murray
rdmurray at bitdance.com
Wed May 29 16:33:54 CEST 2013
On Tue, 28 May 2013 22:20:33 -0400, Tres Seaver <tseaver at palladion.com> wrote:
> > So, my point is that the information on what python code is actually
> > being called ought to be in the stub script file, as a comment if
> > nothing else, for discoverability reasons.
> > I'm not bothered enough to work up a patch, though :)
> It is there already:
> # EASY-INSTALL-ENTRY-SCRIPT: 'pip==1.3.1','console_scripts','pip'
> Which says, load the entry point named 'pip' from the 'console_scripts'
> entry point group in the 'pip 1.3.1' distribution.
> The 'entry_points.txt' metadata file specifies that that entry point is a
> function named 'main' inside the 'pip' package itself.
Ah, but you had to *decode* that for me, using your non-local expert's
I assume 'main' is defined in or imported into pip's __init__?
Now, if the comment had said:
# Call pip.main (per the specification in the pip entry of the
# console_scripts section of pip-1.3.1-egg-info/entrypoints.txt).
then I would have known everything I needed to know without either
consulting the *implementor's* documentation for setuptools or an
expert such as yourself. Of that, as a *user*, the first two words
are the only thing I'm interested in, but the other information could
be handy in debugging certain specialized and unlikely issues, such as
when someone has manually changed the entrypoints.txt file.
Note that the comment still requires you to know python import
semantics...but if you don't know that much you wouldn't get far looking
at the source code anyway. The dir/filename lets you 'find' the
entrypoints.txt file even if you don't know where on your system that
file is installed.
More information about the Python-Dev