[Distutils] executable egg & top-level __main__.py: SOLVED

Dimitri Maziuk dmaziuk at bmrb.wisc.edu
Fri Jun 19 19:19:30 CEST 2015

On 06/19/2015 11:59 AM, Daniel Holth wrote:
> Sorry. The forgettable py_modules parameter is one reason why distutils is
> terrible and we should stop using it. No we don't have a general
> replacement to recommend yet.

Well, it could be mentioned in the "eggsecutable scripts" section, esp.
since what that has now doesn't really parse anyway:

 entry_points = {
        'setuptools.installation': [
            'eggsecutable = my_package.some_module:main_func',

OK, so is "eggsecutable" a keyword or can we call it "rose" instead?
It's list so what happens when I put more than one "eggsecutable =" in?
Key name implies this will run during installation, that's a bit
counter-intuitive (unless it's an error and that does actually run at
install and not when you try to execute the egg). And so on.

Whereas when you look elsewhere you'll find that a) .egg is a zip file
and b) when there's a __main__.py in a zip file, python 2.6+ will
execute it.

> Just keep in mind that having a top-level __main__, if you install two such
> packages, one __main__ will clobber the other.

Right, thanks. No, the goal is specifically to not install these
packages: just run the egg -- so if anybody wants to install, they're
welcome to keep the pieces. That does prompt another question, though:
what happens if you install two packages with conflicting
'setuptools.installation'? Or 'console_scripts'? I mean, is the problem
really only limited to conflicting __main__.py?

Dimitri Maziuk
BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20150619/27eeddce/attachment.sig>

More information about the Distutils-SIG mailing list