[Python-Dev] Bilingual scripts (original) (raw)

Tres Seaver tseaver at palladion.com
Wed May 29 04:20:33 CEST 2013


-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

On 05/28/2013 05:52 PM, R. David Murray wrote:

On Tue, 28 May 2013 12:17:49 -0400, Tres Seaver <tseaver at palladion.com> wrote:

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

On 05/28/2013 11:41 AM, R. David Murray wrote: I have the same complaint about setuptools entry-point scripts, where I still haven't figured out how to go from what is in the file to the code that actually gets called. Hmm, just dump the 'entrypoints.txt' file in the named distribution's EGG-INFO directory? E.g.: $ cat bin/pip #!/path/to/virtualenv/bin/pythonX.Y # EASY-INSTALL-ENTRY-SCRIPT: 'pip==1.3.1','consolescripts','pip' requires = 'pip==1.3.1' import sys from pkgresources import loadentrypoint if name == 'main': sys.exit( loadentrypoint('pip==1.3.1', 'consolescripts', 'pip')() ) $ cat lib/pythonX.Y/site-packages/pip-1.3.1-pyX.Y.egg/EGG-INFO/entrypoints.txt [console_scripts] pip = pip:main pip-X.Y = pip:main I'm afraid I'm still not enlightened. I'm sure I would understand this if I had ever set up an entry point, since I would have had to read the docs on how to do it. But I never have. 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.

Ters. - --

Tres Seaver +1 540-429-0999 tseaver at palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEUEARECAAYFAlGlZesACgkQ+gerLs4ltQ50xACeJUBMjAvMBaOm63Viigz2bvkP S5gAl2w4WAxgasXie10DMtHJOyRRFvA= =34KH -----END PGP SIGNATURE-----



More information about the Python-Dev mailing list